Methods and Apparatus for Applying Complex Continuous Gradients to Images

ABSTRACT

Methods and apparatus for specifying complex continuous gradients. A field blur tool may provide a user interface through which users may apply instances of a field blur pattern. The field blur tool allows the user to place one, two, or more pins over the image and to specify the blur amount (blur radius) at each field blur pin. A blur algorithm distributes the blur values for the one or more instances of the field blur pattern over the entire image, applying the blur according to the locations of the pin(s) and blur parameters at the pin(s). If the input indicates the location and the value for the blur radius of each of two or more instances of the field blur pattern, the two or more instances of the field blur pattern are combined in a blur mask by multiplying normalized radius fields of each of the instances.

PRIORITY INFORMATION

This application claims benefit of priority of Indian Patent ApplicationSerial No. 610/DEL/2012 entitled “Methods and Apparatus for ApplyingBlur Effects to Images” filed Mar. 2, 2012, the content of which isincorporated by reference herein in its entirety.

BACKGROUND Description of the Related Art

Conventional blur techniques tend to be limited and restricting, and donot provide the user with the flexibility to easily and interactivelycreate and combine a wide variety of blur effects.

SUMMARY

Various embodiments of methods and apparatus for specifying complexcontinuous gradients, referred to herein as a field blur, or field blurpattern, are described. A blur module may provide a field blur tool viathe user interface through which users may apply the field blur pattern.In at least some embodiments, the field blur tool allows the user toplace one, two, or more pins over the image and to specify the bluramount (blur radius) at each field blur pin. A blur algorithmdistributes the blur values over the entire image, applying the bluraccording to the locations of the pin(s) and blur parameters at thepin(s).

In at least some embodiments of a field blur technique, input indicatinga location for each of one or more instances of a field blur pattern tobe applied to an input image and a value for a blur radius at each ofthe one or more instances of the field blur pattern may be obtained, forexample via a user interface. A blur mask for the input image may begenerated according to the location and the blur radius of each of theone or more instances of the field blur pattern. In at least someembodiments, the blur mask specifies a blur radius at each pixel of theinput image. At least a portion of an output image including the blureffect may be rendered by applying at least a portion of the blur maskto at least a portion of the input image. If the input indicates thelocation and the value for the blur radius of each of two or moreinstances of the field blur pattern, the two or more instances of thefield blur pattern are combined in the blur mask by multiplyingnormalized radius fields of each of the instances.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a high-level flowchart of operations of a blur module,according to at least some embodiments.

FIG. 2A shows an example image that includes a field blur generated withtwo pins, according to at least some embodiments.

FIG. 2B shows the normalized blur radius field associated with the twopins in FIG. 2A, according to at least some embodiments.

FIG. 3A shows an example image that includes a field blur generated withthree pins, according to at least some embodiments.

FIG. 3B shows the normalized blur radius field associated with the threepins in FIG. 3A, according to at least some embodiments.

FIGS. 4A through 4E illustrate a normalization effect, according to atleast some embodiments.

FIGS. 5A through 5E illustrate the selection bleed technique, accordingto at least some embodiments.

FIGS. 6A through 6D illustrate another image with varying amounts ofselection bleed specified for the field blur, according to at least someembodiments.

FIGS. 7A through 7C show graphs that illustrate boosting, according toat least some embodiments.

FIG. 8 illustrates an example user interface to a blur module, accordingto at least some embodiments.

FIGS. 9A through 9C illustrate applying iris blur to an example image,according to at least some embodiments.

FIGS. 10A and 10B illustrate an example iris blur interface and exampleiris blur patterns in which the inner and outer controls provided by theuser interface may be manipulated to produce a modulated blur mask,according to at least some embodiments.

FIGS. 11A through 11H illustrate applying tilt-shift blur to an exampleimage, according to at least some embodiments.

FIGS. 12A and 12B illustrate applying field blur to an example image,according to at least some embodiments.

FIGS. 13A and 13B illustrate manipulating the light range of an irisblur in an example image, according to at least some embodiments.

FIGS. 14A through 14C illustrate applying multiple blur patterns to animage, according to at least some embodiments.

FIGS. 15A through 15D illustrate applying field blur and bokeh to anexample image, according to at least some embodiments.

FIGS. 16A through 16D illustrate applying tilt-shift blur to an exampleimage, according to at least some embodiments.

FIG. 17 is a high-level flowchart of a field blur technique, accordingto at least some embodiments.

FIG. 18 is a high-level flowchart of a selection bleed technique,according to at least some embodiments.

FIG. 19 is a high-level flowchart of a bokeh technique, according to atleast some embodiments.

FIG. 20 illustrates an example field blur user interface, according toat least some embodiments.

FIG. 21 illustrates an example iris blur user interface, according to atleast some embodiments.

FIG. 22 illustrates an example tilt-shift blur user interface, accordingto at least some embodiments.

FIG. 23 illustrates a blur module that may implement one or more of theblur techniques, according to at least some embodiments.

FIG. 24 illustrates an example computer system that may be used inembodiments.

While the invention is described herein by way of example for severalembodiments and illustrative drawings, those skilled in the art willrecognize that the invention is not limited to the embodiments ordrawings described. It should be understood, that the drawings anddetailed description thereto are not intended to limit the invention tothe particular form disclosed, but on the contrary, the intention is tocover all modifications, equivalents and alternatives falling within thespirit and scope of the present invention. The headings used herein arefor organizational purposes only and are not meant to be used to limitthe scope of the description. As used throughout this application, theword “may” is used in a permissive sense (i.e., meaning having thepotential to), rather than the mandatory sense (i.e., meaning must).Similarly, the words “include”, “including”, and “includes” meanincluding, but not limited to.

DETAILED DESCRIPTION OF EMBODIMENTS

In the following detailed description, numerous specific details are setforth to provide a thorough understanding of claimed subject matter.However, it will be understood by those skilled in the art that claimedsubject matter may be practiced without these specific details. In otherinstances, methods, apparatuses or systems that would be known by one ofordinary skill have not been described in detail so as not to obscureclaimed subject matter.

Some portions of the detailed description which follow are presented interms of algorithms or symbolic representations of operations on binarydigital signals stored within a memory of a specific apparatus orspecial purpose computing device or platform. In the context of thisparticular specification, the term specific apparatus or the likeincludes a general purpose computer once it is programmed to performparticular functions pursuant to instructions from program software.Algorithmic descriptions or symbolic representations are examples oftechniques used by those of ordinary skill in the signal processing orrelated arts to convey the substance of their work to others skilled inthe art. An algorithm is here, and is generally, considered to be aself-consistent sequence of operations or similar signal processingleading to a desired result. In this context, operations or processinginvolve physical manipulation of physical quantities. Typically,although not necessarily, such quantities may take the form ofelectrical or magnetic signals capable of being stored, transferred,combined, compared or otherwise manipulated. It has proven convenient attimes, principally for reasons of common usage, to refer to such signalsas bits, data, values, elements, symbols, characters, terms, numbers,numerals or the like. It should be understood, however, that all ofthese or similar terms are to be associated with appropriate physicalquantities and are merely convenient labels. Unless specifically statedotherwise, as apparent from the following discussion, it is appreciatedthat throughout this specification discussions utilizing terms such as“processing,” “computing,” “calculating,” “determining” or the likerefer to actions or processes of a specific apparatus, such as a specialpurpose computer or a similar special purpose electronic computingdevice. In the context of this specification, therefore, a specialpurpose computer or a similar special purpose electronic computingdevice is capable of manipulating or transforming signals, typicallyrepresented as physical electronic or magnetic quantities withinmemories, registers, or other information storage devices, transmissiondevices, or display devices of the special purpose computer or similarspecial purpose electronic computing device.

Various embodiments of methods and apparatus for providing simultaneous,non-destructive blur patterns in an interactive environment aredescribed. Embodiments of a blur module are described that renderphysically-realistic, spatially-varying blurs in digital images while atthe same time giving users the flexibility to produce creative blureffects not provided in conventional blurring techniques via aninterface to the blur module. Embodiments of the blur module may provideseveral different types of blur patterns, all of which are available ina given session. Each different type of blur pattern can be combinedwith one or more of the other blur patterns non-destructively. Each blurpattern has a corresponding on-canvas user interface element or elements(e.g., a widget) that can be manipulated for a live preview. Theinternal framework of the blur module allows embodiments to handle manyif not all possible scenarios user-interactivity.

Embodiments of the blur module may provide non-destructive techniquesfor performing blurring. In at least some embodiments, parameters suchas pin locations and their properties, as well as bokeh and selectionbleeding parameters, may be parameterized and stored with relativelylittle memory. This lightweight representation of the blur patterns canthen be easily reapplied to the same image or to other images. Thelightweight representation of the blur patterns can be used, forexample, to restart a previous blurring operation, which is critical inenabling non-destructive workflows.

Embodiments of the blurring techniques described herein may be appliedin a variety of color spaces, including but not limited to RGB, CMYK,LAB, and grayscale color spaces.

At least some embodiments of the blur module may provide different typesof blur patterns, referred to herein as field blur, iris blur andtilt-shift. Embodiments may also provide a bokeh effect that may becombined with one or more of the blur patterns. In at least someembodiments, an intuitive on-canvas widget is provided via the userinterface for each type of blur pattern. In at least some embodiments,each widget may include or provide one or more control elements that canbe used to control various parameters such as position, amount of blur,amount of feather, etc. Using embodiments, a user can generate multipleinstances of a given blur pattern (i.e., multiple widgets). In addition,one or more instances of a given blur pattern may be combined with oneor more instances of a different blur pattern, and the other blurpatterns may be combined with these instances as well. Thus, field blurwidgets, iris blur widgets, and/or tilt-shift widgets may be combinedand manipulated in a single image as the user desires to achieve a widevariety of combined blur patterns. In addition, in at least someembodiments, a bokeh effect is provided that may be combined with one ormore of the blur patterns.

In addition to allowing the coexistence of the various blur patterns bycombining blur instances in an image, in at least some embodiments, allof the blur pattern instances in an image share a single radius field.The following describes a method for computing a blur radius field,according to at least some embodiments.

Within each blur pattern (e.g., field blur, iris blur, tilt-shift,etc.), multiple blur pins may combine their effects by multiplying theirnormalized radius fields. Between patterns, on the other hand, themultiple blur pins combine by addition of the normalized fields. Thenormalized fields, along with the maximum blur radius amount, determinethe per-pixel blur radius which then drives the spatially varying blur.In at least some embodiments, a normalized radius field ranges in valuebetween 0.0 and 1.0, and may be obtained by producing the radius fieldin units of pixels and then dividing by the maximum radius value. Theblur radius field is then given by the product of the maximum radiusvalue and the normalized radius field.

Embodiments of the blur module may provide several types of spatiallyvarying blur patterns—e.g., field blur, iris blur and tilt-shift blur.However, each of these blur patterns, or any combination thereof, mayuse an underlying spatially varying blurring algorithm which, in atleast some embodiments, applies a spatially varying elliptical-kernelblur where the blur radius at pixels is determined according to thevalues in the radius field (blur mask), which vary between 0.0 (no blur)to 1.0 (maximum blur), with smoothly varying values in between. In atleast some embodiments, the blur kernel may be a circular aperturekernel with the blur radius at a given pixel in the radius field used asthe kernel radius. However, in at least some embodiments, the blurkernel may be distorted to form an elliptical kernel, with a major axisand minor axis rather than a fixed radius.

In at least some embodiments, the blur module and user interface mayalso allow the user to select individual blur widgets, switch betweenblur patterns, and enable or disable a blur pattern, for example usingcheckboxes or the like.

In at least some embodiments, the blur module may work within anarchitecture of the digital image processing application environment tosupport non-destructive workflows, for example using “smart object”technology or the like. In at least some embodiments, the blur modulemay capture all of the user interactions using the on-canvas elements.In addition, in at least some embodiments, all of the final blurpatterns can be parameterized using a lightweight representation of thecomponent blur patterns, including information such as, widget type,widget location, amount of blur, amount of feather, amount of focus,amount of bokeh, etc. This information is stored in a data structurethat may be referred to as a “smart object.” This, for example, allowsthe user to restart a previous blur session and to pick up exactly wherethey left off, or to apply a blur effect generated for one image toanother image.

In at least some embodiments, the blur module may provide a level ofperformance that gives fluidity to interactions. In at least someembodiments, the blur module may achieve frame rates of interactivity onCPU as well as on GPU by implementing a framework that handles allpossible user interactions. Types of user interactions supported by theframework may include, but are not limited to, the following:

-   -   Render the screen while the user is actively manipulating a        widget of slider, i.e., upon MOUSE-DOWN.    -   Render the result at the given preview level upon MOUSE-UP.    -   Render the base level of the pyramid, or do FINAL APPLICATION,        when the user commits the combined blur patterns.

MOUSE-DOWN: In at least some embodiments, when the user is busyinteracting with the on-canvas controls, the blur module may stayinteractive by rendering a downsampled (e.g., 512×512) version of theimage and scaling that back up to the required screen resolution. Thisprovides the user with a coarse answer to the current blur pattern whilethey are interactively manipulating the blur pattern.

MOUSE-UP: In at least some embodiments, when the user releases themouse, the blur module renders the appropriate level of the pyramid thatcorresponds to the screen resolution. However, since this operation canbe slow, this may be performed one area at a time. The entire answer atthe screen resolution may be computed in many areas, and each area isupdated on the screen once it is processed. In at least someembodiments, a relatively small and non-intrusive progress-update may bedisplayed to inform the user when the entire screen will finishupdating. This screen update is an interruptible operation, which meansthat the user does not have to wait until it is finished, and thus isfree to interact with the user interface whenever and however theyplease.

FINAL APPLICATION: This operation (final application of the blurpattern(s)) may not need to be interactive; potentially, gigabytes ofdata may be rendered. However, such large images may be handledgracefully by embodiments. In at least some embodiments, the finalapplication may be accelerated by the use of a GPU or GPUs, which mayprovide significantly faster final rendering than simply using a CPU toperform the final rendering.

FIG. 1 is a high-level flowchart of operations of a blur module,according to at least some embodiments. As indicated at 100, an imagemay be obtained, and at least a portion of the image may be displayed ona canvas. As indicated at 102, input may be received selecting a blurpattern (e.g., a field blur, an iris blur, or a tilt-shift blur). Forexample, the user may select a particular blur tool and/or the bokehtool as illustrated in FIG. 8. Note that, if there are multipleinstances of a blur pattern or patterns (e.g., multiple pins for a fieldblur, or multiple instances of an iris blur, or multiple instances of atilt-shift blur) on the canvas, this input may select a particular oneof the blur instances, e.g. by selecting a respective pin, or by addinga new pin. This input may also or instead select a blur pattern byselecting the respective control pane in FIG. 8. As indicated at 104,input may be received adjusting parameters of the current blur patternon the canvas. For example, the input may tweak a respective widget, asshown in FIG. 8. As another example, the input may add or delete pins.As another example, the input may adjust one or more UI elements in therespective control pane for the current blur pattern as shown in FIG. 8.As another example, the input may adjust bokeh settings, or turn bokehon or off, for the currently selected blur pattern instance, for exampleusing the bokeh controls as shown in FIG. 8.

As indicated at 106, the blur pattern may be interactively applied tothe image according to the parameters. While the user is interactivelyselecting and adjusting blur patterns in elements 102 and 104 via a userinterface, in at least some embodiments, the blur module may provide alevel of performance that gives fluidity to interactions. In at leastsome embodiments, the blur module may achieve frame rates ofinteractivity on CPU as well as on GPU by implementing a framework thathandles all possible user interactions, as previously described.

At 108, after the user has finished with the current blur patterninstance, if the user desires to add (or adjust) more blur patterninstances, the method may return to element 102. If the user is done,then the method may proceed to element 110, where the resulting imagemay be rendered and output. Note that a final rendering may be performedto apply the specified blur patterns according to the radius field (blurmap), if necessary. In at least some embodiments, this final rendering(final application) may be performed at least in part on a GPU or GPUs.

The following sections describe blur patterns and related techniquesthat may be provided by various embodiments of a blur module and/or blurmethod as described herein. The blur patterns and related techniquesthat may be provided by a blur module may include one or more of, butare not limited to, a field blur pattern, an iris blur pattern, atilt-shift pattern, a bokeh technique for creating bokeh effects, and aselection bleed technique that allows the user to control bleeding atthe edges of a blur region or selection.

Field Blur

At least some embodiments of a blur module may provide a non-destructivemethod for specifying complex continuous gradients, referred to hereinas a field blur, or field blur pattern. At least some embodiments of theblur module may provide a field blur tool via the user interface throughwhich users may apply the field blur pattern. In at least someembodiments, the field blur tool allows the user to place one, two, ormore pins over the image and to specify the blur amount (blur radius) ateach field blur pin. A blur algorithm distributes the blur values overthe entire image, applying the blur according to the locations of thepin(s) and blur parameters at the pin(s). FIGS. 2A-2B and 3A-3B areprovided as examples of the field blur pattern, and each show two ormore pins applied to an image via the field blur user interface (UI) andfield blur parameter(s) adjusted via the UI, to produce the field blurpattern. FIGS. 12A-12B shows an additional example of applying the fieldblur pattern, as well as an example UI for the field blur pattern. Theimage used in FIGS. 2A, 3A, and 12A is provided courtesy ofNASA/JPL/California Institute of Technology. FIG. 20 shows an example UIto the field blur tool, according to at least some embodiments.

FIG. 17 is a high-level flowchart of a field blur technique, accordingto at least some embodiments. As indicated at 900, input indicating alocation for each of one or more instances of a field blur pattern to beapplied to an input image and a value for a blur radius at each of theone or more instances of the field blur pattern may be obtained, forexample via the example UI as illustrated in FIG. 20. As indicated at910, a blur mask for the input image may be generated according to thelocation and the blur radius of each of the one or more instances of thefield blur pattern. In at least some embodiments, the blur maskspecifies a blur radius at each pixel of the input image. As indicatedat 920, at least a portion of an output image including the blur effectmay be rendered by applying at least a portion of the blur mask to atleast a portion of the input image. If the input indicates the locationand the value for the blur radius of each of two or more instances ofthe field blur pattern, the two or more instances of the field blurpattern are combined in the blur mask by multiplying normalized radiusfields of each of the instances. The elements of the flowchart of FIG.17 are described in more detail below.

The field blur pattern as applied by the field blur tool may simplifythe process of creating complex gradient fields. Embodiments of thefield blur algorithm applied by the field blur tool may modulate imageblurring. Embodiments of the field blur tool may provide a userexperience which unites the process of producing 1) a spatially uniformblur; 2) a spatially varying blur controlled by a linear gradient ofblur radii; and 3) a spatially varying blur with gradients which aremore complex than linear. All of this is done in a manner that isintuitive to the user of the field blur tool. In at least someembodiments, the masks (see, e.g., FIGS. 2B and 3B) generated using thefield blur tool may be used to control other image adjustments andfilters than blur.

In at least some embodiments, to achieve a spatially uniform blur, asingle focus pin may be placed anywhere on the image, and an on-canvasfield blur UI (referred to herein as a field blur widget) may bedisplayed at the pin. FIG. 20 shows an example field blur widget 300,according to at least some embodiments. In at least some embodiments,the field blur widget includes at least a focus control wheel. The focuscontrol wheel allows the user to control the uniform blur amount (i.e.,the blur radius), for example by grabbing and rotating (or otherwisemanipulating) a handle on the focus control wheel using a cursor controldevice such as a mouse, or alternatively using a stylus or finger on atouch- or multitouch-enabled device. In at least some embodiments,fields blur parameter(s) (e.g., the blur amount or blur radius) may beinstead or alternatively controlled using other field blur UI controls.FIG. 20 shows an example field blur control 222 that includes a blurslider bar that the user may manipulate to control the blur amount(i.e., the blur radius), in at least some embodiments. Note that theblur radius may be expressed in pixels, in at least some embodiments. Inat least some embodiments, the blur amount (blur radius) may be setwithin a range from 0 (no blur) to a maximum blur radius. The maximumblur radius may be an implementation-dependent threshold amount. In atleast some embodiments, the maximum blur amount may be specified by theuser via the UI. Alternatively, the maximum blur amount may be a fixedthreshold in the blur module implementation. Note that, in at least someembodiments, in generating the radius field (blur mask), the blur radiuscontributions from the pins at each pixel may be normalized to withinthe range [0.0 . . . 1.0], where 0.0 is no blur and 1.0 is maximum blur.

In at least some embodiments, to achieve a spatially varying blurcontrolled by a linear gradient of blur radii, the user may place asecond focus pin on the image (see, e.g., FIGS. 2A-2B). The blur amountfor this pin may be controlled independently of the first pin using anon-canvas field blur widget at the second pin, or alternatively usingother field blur UI controls. In this way, the user may create aspatially varying blur that has two specified blur amounts, one at eachfocus pin. FIG. 2B shows a blur mask generated according to the two pinsand the respective blur radius setting at each of the pins. FIG. 2Ashows the blur as produced in a sample image by the blur mask of FIG.2B. In at least some embodiments, the UI to the blur module may provideone or more user interface elements via which the user may togglebetween the image view and the mask view on the canvas. Note that, inthe blur masks as shown in the accompanying Figures and as discussed inthe text, white indicates a maximum blur amount (blur radius=maximumblur radius), black indicates no blur (blur radius=0), and shades ofgray indicate blur radii in between the maximum blur radius and blurradius=0. However, white=no blur and black=maximum blur is used byconvention, and the reverse (white=maximum blur, black=no blur) couldalso be used in some implementations.

In at least some embodiments, to achieve a spatially varying blur withgradients that are more complex than linear, the user may place one ormore additional pins to provide additional points of constraint for theblur amount. FIGS. 3A and 3B show an example in which three pins havebeen placed on the canvas. Each pin's blur amount is independent of allthe others. A field blur widget may be selectively displayed at eachpin, e.g., by selecting the respective pin via the UI, to adjust thefield blur amount (blur radius) at that pin. FIG. 3B shows a blur maskgenerated according to the three pins and the respective blur radiussetting at each of the pins. FIG. 3A shows the blur as produced in asample image by the blur mask of FIG. 3B. FIGS. 12A and 12B show anadditional example of the field blur in which four pins are used tocontrol the blur radius to achieve a complex spatially varying blur.FIG. 12A also illustrates the application of the bokeh effect to thefield blur, according to at least some embodiments.

Field Blur Implementation Details

The following provides implementation details for providing field blursfor scenarios 1 (single pin, spatially uniform blur), 2 (two pins,spatially varying blur controlled by a linear gradient of blur radii),and 3 (three or more pins, spatially varying blur with complexgradients) according to some embodiments, and is not intended to belimiting.

In at least some embodiments, a spatially varying blur function takes asan argument the radius field (illustrated by a blur mask as shown inFIGS. 2B and 3B) that specifies the blur radius at every pixel. Thatfield may be generated as follows.

In scenario 1, the case of one focus pin with blur radius amount R0 (inunits of pixels), the field has a constant value of R0 (the blur radiusamount).

In scenario 2, the case of two focus pins with blur radius amounts R0and R1 (pixels) placed at pixel locations (x0, y0) and (x1, y1)respectively, the field at image location (x, y) has a value field (x,y), which may be determined as follows. Double-slashes (“//”) indicatecomments:

-   -   Rmax=maximum (R0, R1);    -   A0=R0/Rmax;    -   A1=R1/Rmax;    -   //the difference vector between the two pin locations    -   x10=x1−x0;    -   y10=y1−y0;    -   dr0_r10=(x−x0)*x10+(y−y0)*y10;    -   r10_sq=x10*x10+y10*y10;    -   //project the current location onto the line between the pins    -   projection=(r10_sq !=0) ? dr0_r10/r10_sq:0;    -   projection=max (0.0, projection);    -   projection=min (projection, 1.0);    -   field=A0+(A1−A0)*projection;

The above algorithm produces a field that varies linearly between A0 andA1 (see, e.g., FIG. 2B). Note that the above algorithm is not intendedto be limiting; variations on this algorithm, or other algorithms, maybe used in some embodiments to produce a linearly varying field betweentwo pins.

FIG. 2A shows an example image that includes a field blur generated withtwo pins, according to at least some embodiments. The field blurlinearly varies between the two pins. FIG. 2B shows the normalized blurradius field (also referred to as a mask) associated with the two pinsin FIG. 2A, according to at least some embodiments. The pins are shownby the “bull's-eye” circles on the images.

In scenario 3, the case of three or more pins, the field is a summationof contributions from each pin, which is then normalized. Each fieldcontribution is formed by weighting the pin's dimensionless blur radiusamount (R[p]/R_max, in the example algorithm given below) with a spatialfactor which varies as the inverse fourth power of the distance of theevaluation point from the pin. Other powers than four can also be used,and thus can allow control over the tightness or looseness of thefield—how constrained the field's contribution is from the field'sassociated pin. An example algorithm to generate the field according tothis technique is provided below. The three pins may be labeled withindex ‘p’ with corresponding blur radii R[p] and locations (x[p], y[p]):

field = 0; normalization = 0; for (p = 0; s < n_pins; ++p)   {   dx_p =x − x[p];   dy_p = y − y[p];   dr_p_sq = dx_p * dx_p + dy_p * dy_p;   f= 1.0 / (dr_p_sq * dr_p_sq + 0.01);   A = R[p] / R_max;   field += f *A;   normalization += f;   } if (0 < normalization)   {   field /=normalization;   field = max (0, field);   field = min (field, 1);   }else   field = 1.0; return field;

The above algorithm produces a field that varies between three or morepins. Note that the above algorithm is not intended to be limiting;variations on this algorithm, or other algorithms, may be used in someembodiments to produce a spatially varying field blur between three ormore pins.

FIG. 3A shows an example image that includes a field blur generated withthree pins, according to at least some embodiments. The field blurvaries between the three pins. FIG. 3B shows the normalized blur radiusfield associated with the three pins in FIG. 3A, according to at leastsome embodiments. The pins are shown by the “bulls-eye” circles on theimages. FIG. 12A shows an example image that includes a field blurgenerated with four pins, according to at least some embodiments. Thefield blur varies between the four pins. FIG. 12B shows the normalizedblur radius field associated with the four pins, according to at leastsome embodiments.

FIG. 20 illustrates an example field blur user interface, according toat least some embodiments. In particular, FIG. 20 shows an exampleon-canvas field blur widget 300 that may be used in some embodiments,displayed at a currently selected one of the field blur pins indicatedby the white circles (selected pin 212). The field blur widget mayinclude at least a focus control wheel that the user may manipulate toadjust the blur radius at the selected pin 212. Alternatively, in atleast some embodiments, the user may adjust the blur radius using a blurcontrol (e.g., a blur slider bar) in field blur controls 222.

In at least some embodiments, the user may also selectively apply abokeh effect to the image, for example using the user interface elementsin bokeh effect controls 228. Examples of the bokeh effect applied toimages with a field blur are shown in FIG. 12A and FIGS. 15A-15D. Inaddition, the user may also selectively apply iris blur and/ortilt-shift blur to the image (see FIGS. 21 22 21 for UIs for applyingiris and tilt-shift blur patterns, respectively). FIGS. 14A-14Cillustrate applying multiple blur patterns (field blur, iris blur, andtilt-shift blur) to an image, according to at least some embodiments.Note that the bokeh effect may be applied to blur region(s) in an imagein which field, iris, and/or tilt-shift blurs have been combined.

Iris Blur

At least some embodiments of a blur module may provide a non-destructivemethod for specifying elliptical blurs that may be used to model an irisblurring effect seen in real-world cameras, referred to herein as aniris blur, or iris blur pattern. At least some embodiments of the blurmodule may provide an iris blur tool via the user interface via whichusers may apply the iris blur pattern. In at least some embodiments, theiris blur tool allows the user to place one, two, or more pins over theimage and to specify iris blur parameters (e.g. a blur radius, ellipsedimensions and shape, feathering region, etc.) at each iris blur pin. Inat least some embodiments, an on-canvas iris blur widget may be providedvia which the user may adjust the various iris blur parameters (see,e.g., FIG. 21). A blur algorithm applies an iris blur pattern accordingto the iris blur parameters at each iris blur pin. FIGS. 9A through 9Care provided as examples of the iris blur pattern, and show an examplein which four iris blur pins are applied to an image via the iris bluruser interface (UI), and iris blur parameter(s) are adjusted via theiris blur UI, to produce a blur pattern that is a combination of thefour iris blurs.

FIG. 21 illustrates an example iris blur user interface, according to atleast some embodiments. In particular, FIG. 21 shows an exampleon-canvas iris blur widget 310 that may be used in some embodiments,displayed at a currently selected one of the iris blur pins indicated bythe four bulls-eye circles at the centers of the four shaded regions.The iris blur widget may include at least a focus control wheel that theuser may manipulate to adjust the blur radius at the selected iris blurpin. Alternatively, in at least some embodiments, the user may adjustthe blur radius using a blur control (e.g., a blur slider bar) in irisblur controls 224. The iris blur widget 310 may also include an irisblur ellipse 214 that indicates the outer boundary of the iris blurpattern. In at least some embodiments, the user may grab and adjust theiris blur ellipse 214 via the cursor control device (for example, at oneof the ellipse control points) to expand, shrink, and/or stretch theellipse 214, to change the shape of the ellipse (e.g., to a morerectangular (non-elliptical) shape), and/or to rotate the ellipse. In atleast some embodiments, the ability to manipulate the shape of theellipse 214 via the user interface allows continuous control of theshape of the ellipse from elliptical (or circular) to rectangular. In atleast some embodiments, the iris bur ellipse 214 may extend beyond theborders of the canvas, for example as illustrated in FIG. 14B.Alternatively, other techniques may be provided to cause the ellipse 214to expand, contract, change shape, rotate, and/or stretch. In addition,an iris blur widget may include one or more feather controls that may bemanipulated by the user to control the inner boundary of the iris blur.The iris blur is “feathered” between the inner boundary indicated bythese feather controls and the ellipse 214. At least some embodimentsmay provide independent control over these inner feather control pointsto thus provide a flexible inner boundary shape. In at least someembodiments, the independent control over the inner feather controlpoints, along with the control of the outer boundary, may enable themodulation of the spatial pattern of the applied lens blur. This featureis further described in the section titled Flexible super-ellipse. In atleast some embodiments, the region inside the inner boundary is notblurred, while the region outside the ellipse 214 is blurred accordingto the blur amount. The region in between (the feathered region) variessmoothly from not blurred at the inner boundary to blurred at the outerboundary. In at least some embodiments, as an alternative or as anoption available to the user, blurring may be applied according to theblur amount within the inner boundary, with no blurring outside theouter boundary and feathered blurring between the two boundaries.

In at least some embodiments, the user may also selectively apply abokeh effect to the image, for example using the user interface elementsin bokeh effect controls 228. In addition, the user may also selectivelyapply field blur and/or tilt-shift blur to the image (see FIGS. 20 and22 for UIs for applying field and tilt-shift blur patterns,respectively). FIGS. 14A-14C illustrate applying multiple blur patterns(field, iris, and tilt-shift blur) to an image, according to at leastsome embodiments. Note that the bokeh effect may be applied to blurregion(s) in an image in which field, iris, and/or tilt-shift blurs havebeen combined.

Flexible Super-Ellipse

In at least some embodiments, the iris blur pattern may provide asuper-ellipse spatial shape that may be used to modulate the spatialpattern of the applied iris blur. In at least some embodiments of theiris blur user interface, for example as illustrated in FIG. 21, thereis an outer super-ellipse ring (which is initially elliptical bydefault) and an inner super-ellipse that is defined by multiple (e.g.,four) inner control points. The inner control points control an innerboundary of the iris blur pattern (see the feather control points inFIG. 21); the outer control points control an outer boundary of the irisblur pattern (see the ellipse 214 with control points in FIG. 21). In atleast some embodiments, the outer control points may be used to formelliptical shapes for the iris blur pattern that vary from substantiallysquare to circular. In at least some embodiments, the region inside theinner boundary is not blurred, while the region outside the outerboundary is blurred according to the blur amount. The region in between(the feathered region) varies smoothly from not blurred at the innerboundary to blurred at the outer boundary.

FIGS. 10A and 10B illustrate an example iris blur interface and exampleiris blur patterns in which the inner and outer controls provided by theuser interface may be manipulated to produce a modulated blur mask,according to at least some embodiments.

FIG. 10A shows an outer boundary for the iris blur pattern that has beenformed into an normal ellipse using the control points on the ellipse.FIG. 10B shows an outer boundary for the iris blur that has been mademore square-like using the control points on the ellipse. In at leastsome embodiments, when the user moves one of the inner control pointsusing a cursor control device while holding down a key (e.g., the Altkey), that point is moved independently of the other control points. Theboundary on which the four inner control points (also referred to asiris blur feather controls) lie forms a new shape which is not that of asuper-ellipse (i.e., the shape made by the outer boundary), but insteadis more flexible or non-regular; this shape may be referred to as aflexible super-ellipse. The result is a flexible or non-regularsuper-ellipse for the inner boundary of the iris blur pattern and anordinary or regular super-ellipse for the outer boundary of the irisblur patter, as illustrated in FIGS. 10A and 10B. In both FIGS. 10A and10B, the shape defined by the white dotted line shows an approximationof the flexible super-ellipse defined in these two examples byindependently manipulating the iris blur feather controls. In someembodiments, a flexible super-ellipse may also (or instead) be used forthe outer boundary of the iris blur pattern.

The following defines a method for specifying the shape of this flexiblesuper-ellipse as well as a method for using the two shapes (the innerflexible super-ellipse and the outer regular super-ellipse) to define afunction to determine the pattern of spatial variation of the desiredblur radius field.

Super-Ellipse Details

As used herein, a super-ellipse is a function that generalizes anellipse to enable the shape to have varying degrees of squareness (see,e.g., FIG. 10B). A defining equation for the super-ellipse, whichrelates the x and y position of a point (x, y) on the super-ellipseshape relative to the origin, is:

${\left( \frac{x}{a} \right)^{s} + \left( \frac{y}{b} \right)^{s}} = 1$

where a and b are the respective horizontal and vertical ellipse radii(major and minor axis radii) and s is a parameter which controls thesquareness. When s=2, the equation describes an ellipse. Values for slarger than 2 produce more rectangular shapes with progressively sharperand sharper corners.

In at least some embodiments, at default settings, the iris blurpattern's outer control curve is elliptical in shape. If the squarenesscontrol on the shape is moved, the squareness parameter, s, is varied toproduce more or less square super-ellipses. This can be done by lettingan angle parameter, A, vary from 0 to 2 pi in small steps and producingthe points (x (A), y (A)) on the super-ellipse as:

x(A)=a[cos(A)]^(−2/s)

y(A)=a[sin(A)]^(−2/s)

Note that in general the super-ellipse may be rotated so that it isoriented along an arbitrary angle. This is achieved by a standardrotation by angle, T, of x and y about the origin of the super-ellipse(taken as (0, 0) here, though not limited to this value):

x′=x cos(T)−y sin(T)

y′=y cos(T)−x sin(T)

For the purpose of simplicity this description will ignore rotations.

Flexible Super-Ellipse Details

In at least some embodiments, the inner control points (i.e., thefeather control points in FIG. 21) in the iris blur user interface lieby default on a super-ellipse that lies inside the outer ring'ssuper-ellipse. No blurring occurs inside the inner shape. Between theinner and the outer shapes the blur radius increases from 0 at the innerboundary to its maximum value, R_(max). In the default case, it sufficesto determine a function, ƒ(x, y), which takes on values of 0 at theinner boundary and values of 1 at the outer boundary. Having found thisfunction, the blur radius, R(x, y), can be found at any location (x, y)by multiplying this function by the maximum blur radius R_(max) (theblur radius at the outer boundary):

R(x,y)=ƒ(x,y)R _(max).

To achieve the flexible super-ellipse for the inner boundary of the irisblur pattern, the inner boundary is generalized to be more flexible thana super-ellipse shape. In at least some embodiments, this may beimplemented by providing separate super-ellipse “radii” for each angularquadrant. The following definitions may be used:

a _(in)(x)=(0<=x)?a ₁ : a ₂

b _(in)(y)=(0<=y)?b ₁ : b ₂

where a₁ and a₂ define the distance from the origin of the left andright control points along the (horizontal) x axis, and b₁ and b₂ definethe distance from the origin of the top and bottom control points alongthe (vertical) y axis.

The inner flexible super-ellipse shape is then specified by generalizingthe super-ellipse share to:

${\left( \frac{x}{a_{{in}{(x)}}} \right)^{s} + \left( \frac{y}{b_{{in}{(y)}}} \right)^{s}} = 1.$

The outer super-ellipse can be specified as

${\left( \frac{x}{a_{out}} \right)^{s} + \left( \frac{y}{b_{out}} \right)^{s}} = 1.$

At this point, there are definitions for the inner flexiblesuper-ellipse boundary and for the outer super-ellipse boundary. Inorder to determine the blur radius needed at each x, y location, afunction, ƒ(x, y) needs to be found which takes on values of 0 at theinner shape and values of unity (1) at the outer shape and which goessmoothly between values of 0 and 1 in-between the two shapes. In atleast some embodiments, this may be accomplished by interpolatingbetween the inner and outer parameters and determining the associatedinterpolation parameter. In at least some embodiments, the interpolatedradii may be defined by

a(ƒ,x)=(1−ƒ)a _(in(x)) +ƒa _(out),

b(ƒ,y)=(1−ƒ)b _(in(y)) +ƒb _(out).

For any specified pixel location (x, y) the value of the interpolatingfunction, ƒ, is found, which makes the corresponding super-ellipse-likeshape pass through the specified point. This is accomplished by ensuringthat the following equation holds:

${\left( \frac{x}{a\left( {f,x} \right)} \right)^{s} + \left( \frac{y}{b\left( {f,y} \right)} \right)^{s}} = 1.$

In other words, for each desired value of x and y, the value off isfound such that the left side of this equation takes on a value ofunity. The equation is nonlinear and there are many techniques forsolving such equations. In at least some embodiments, a combination offirst order and second order approximation methods may be used. In atleast some embodiments, specifically, Newton's first order method may beused in combination with Halley's second order method.

In at least some embodiments, ƒ may be initialized to have a value of0.3, and two second order iterations followed by six first orderiterations may be used. In at least some embodiments, the number offirst order iterations may be reduced by checking an error measure ateach iteration and ending the calculation if the error measure is lessthan some prescribed threshold value.

At least some embodiments solve for the value off that makes thefunction:

$G = {\left\lbrack {\left( \frac{x}{a\left( {f,x} \right)} \right)^{s} + \left( \frac{y}{b\left( {f,y} \right)} \right)^{s}} \right\rbrack^{1/s} - 1}$

as close to zero as possible. In other words, G(ƒ) is the function forwhich Newton or Halley's method is used to find the solution for ƒ whichmakes G close to zero. The following describes an algorithm that may beused to accomplish this, in at least some embodiments, and is notintended to be limiting.

The algorithm begins with an initial value of ƒ=0.3. The second ordermethod is then repeated two times:

repeat twice:

-   -   calculate G, and calculate G′ and G″, its first and second        derivatives with respect to ƒ.    -   update:

ƒ=ƒ+(G/G′)/[1+sqrt{1−2(G/G′)(G″/G′)}]

The first order method is then repeated six times:

-   -   calculate G and G′, its derivative with respect to ƒ.    -   update:

ƒ=ƒ−G/G′

In at least some embodiments, as a final step, the resultant value offmay be modified to produce a softer gradation near values of zero. Thismay be performed with a fifth order modulation:

c ₀=5.0;

c ₁=10.0−4.0*c ₀;

c ₂=5.0*(c ₀−3.0);

c ₃=6.0-2.0*c ₀;

ƒ_(modulated)=ƒ*ƒ*(c ₀+ƒ*(c ₁+ƒ*(c ₂ +ƒ*c ₃)));

Note that the value is set to zero whenever the point (x, y) lies withinthe inner flexible super-ellipse and is set to unity when it liesoutside the outer super-ellipse. The resultant values for ƒ_(modulated)may be displayed as the mask values, for example when the user pressesthe M key in iris blur mode. See the example blur field masks generatedaccording to this method in FIGS. 10A and 10B. ƒ_(modulated) may also beused to produce the spatially varying blur radius field bymultiplication with the maximum blur radius.

Tilt-Shift Blur

At least some embodiments of a blur module may provide a non-destructivemethod for specifying tilt-shift blurs that may be used to model atilt-shift blurring effect seen in real-world cameras, referred toherein as a tilt-shift blur, or tilt-shift blur pattern. At least someembodiments of the blur module may provide a tilt-shift blur tool viathe user interface via which users may apply the tilt-shift blurpattern. In at least some embodiments, the tilt-shift blur tool allowsthe user to place one, two, or more pins over the image and to specifytilt-shift blur parameters (e.g. a blur radius, tilt-shift dimensions,feathering region, etc.) at each tilt-shift blur pin. In at least someembodiments, an on-canvas tilt-shift blur widget may be provided viawhich the user may adjust the various tilt-shift blur parameters (see,e.g., FIG. 22). A blur algorithm applies the tilt-shift blur patternaccording to the tilt-shift blur parameters at each tilt-shift blur pin.FIGS. 11A through 11H are provided as examples of the tilt-shift blurpattern. FIGS. 11A and 11B show a single tilt-shift blur. FIG. 11B showsthe radius field (blur mask) for the single pin, and FIG. 11A shows animage blurred according to the mask in FIG. 11B. FIG. 11C shows anexample radius field (blur mask) generated according to two tilt-shiftblur pins and the tilt-shift settings at the two tilt-shift blurs. Thetwo tilt-shift blurs are applied to the image via the tilt-shift bluruser interface (UI), and tilt-shift blur parameter(s) may be adjustedindependently at each tilt-shift pin, via the tilt-shift blur UI toproduce a radius field (blur mask) that is a combination of the twotilt-shift blurs, as shown in FIG. 11C. FIGS. 16A-16D provide anotherexample of applying the tilt-shift blur to an example image, with FIGS.16A-16B showing the image and radius field as generated according to asingle tilt-shift blur, and FIGS. 16C-16D showing the image and radiusfield as generated according to two tilt-shift blurs. Note that, asshown in the example Figures, the tilt-shift blurs may be rotated fromhorizontal to vertical, and to all angles in between.

FIG. 22 illustrates an example tilt-shift blur user interface, accordingto at least some embodiments. In particular, FIG. 22 shows an exampleon-canvas tilt-shift blur widget 330 that may be used in someembodiments, displayed at a currently selected one of the tilt-shiftblur pins indicated small white circles (there are two tilt-shift blurpins in this example). The tilt-shift blur widget may include at least afocus control wheel that the user may manipulate to adjust the blurradius at the currently selected tilt-shift blur pin. Alternatively, inat least some embodiments, the user may adjust the blur radius using ablur control (e.g., a blur slider bar) in tilt-shift blur controls 226.The tilt-shift blur widget 320 may also include two or more bars 216that may be displayed as part of the tilt-shift blur widget to indicateranges of the tilt-shift blur pattern. The bars 216 may be movedrelative to each other and/or relative to the respective pin for thetilt-shift blur instance, may be rotated, and so on via the mouse orother control device. In at least some embodiments, the bars 216 mayinclude two outer bars 216A and two inner bars 216B, as illustrated inFIG. 22. In at least some embodiments, no (zero) blur may be appliedwithin the inner bars 216B, a maximum blur may be applied outside theouter bars 216A, and the blur pattern may be feathered between the innerbars 216B and outer bars 216A, from zero at the inner bars 216B tomaximum at the outer bars 216A. The two inner bars 216B enable thewidening of the central region of sharpness (and the narrowing of thefeathered region between the inner and outer bars) beyond what isachievable in conventional blur tools, and beyond what is normallyachieved with the physical tilting of a camera lens. In at least someembodiments, as an alternative or as an option available to the user,blurring may be applied according to the blur amount within the innerbars 216B, with no blurring outside the outer bars 216A and featheredblurring between the inner and outer bars.

In at least some embodiments, the user may also selectively apply abokeh effect to the image, for example using the user interface elementsin bokeh effect controls 228. In addition, the user may also selectivelyapply field blur and/or iris blur to the image (see FIGS. 20 and 21 forUIs for applying field and iris blur patterns, respectively). FIGS.14A-14C illustrate applying multiple blur patterns (field, iris, andtilt-shift blur) to an image, according to at least some embodiments.Note that the bokeh effect may be applied to blur region(s) in an imagein which field, iris, and/or tilt-shift blurs have been combined.

As shown in FIG. 22, the tilt-shift blur controls 226 may also includesymmetric distortion controls. For example, a check box may be providedto activate symmetric distortion, and a slider bar may be provided toset the symmetric distortion. In at least some embodiments, symmetricdistortion may default to zero (0), but may be adjusted to any point inthe range −100% (maximum negative distortion) to 100% (maximum positivedistortion). FIGS. 11E through 11H illustrate applying symmetric andnon-symmetric distortion to the tilt-shift blur pattern in an exampleimage, according to at least some embodiments. The bokeh effect is alsoselected and bokeh parameters are differently adjusted in some of theseFigures. FIG. 11D illustrates non-symmetric, positive distortion;symmetric distortion is not selected in controls 228, and the distortionvalue is set to maximum positive distortion (100%). Note that the“sparkles” at the light points are elliptical, with the major axes ofthe ellipses pointing towards the tilt-shift pin.

FIG. 11E illustrates non-symmetric, negative distortion; symmetricdistortion is not selected in controls 228, and the distortion value isset to maximum negative distortion (−100%). Note that the “sparkles” atthe light points are elliptical, with the major axes of the ellipsesorthogonal to the tilt-shift pin. FIG. 11F illustrates symmetric,negative distortion; symmetric distortion is selected in controls 228,and the distortion value is set to maximum negative distortion (−100%).FIGS. 11G and 11H both illustrate zero distortion; symmetric distortionis selected in controls 228 with the distortion value set to zero (0).However, note that bokeh color is set to zero (0%) in FIG. 11G, and to100% in FIG. 11H. While difficult to see the effect of colorfulnessadded to the image via the bokeh color setting in the grayscalerendering of the images, note that at least some of the sparkles in FIG.11H are brighter than respective sparkles in FIG. 11G.

Continuously Adjustable Bleed of Selected Region Blurring

Typically when a selection is blurred, the resultant blur is influencedby the regions outside of the selection (e.g., the background). Thisphenomenon is called color bleeding, or simply bleeding. This behavioris at times unwanted, for example when blurring a foreground objectagainst the background, and may be especially exaggerated when both theselection and the background are composed of different colors.

Conventional blurs such as a Gaussian blur may allow selective blurringwithin a selected region. Outside the selection, the image remainsunblurred; it is only blurred within the selected region. However, theblur is obtained by mixing values both inside and outside of theselection. This bleeding of image colors from outside the selection mayproduce undesired results. As an example, consider a selectioncontaining a yellow flower that exists against a green background. Inconventional blurs, blurring of the selected flower may mix in thebackground green, and the flower will hence turn greenish. A more commonselection scenario is inverse selection; the background is selected asthe region to blur and the flower is to be left unblurred. In this case,in conventional blurs, the flower color may bleed into the backgroundgreen upon blurring. Too much bleeding looks artificial. If the intentis to simulate the kinds of depth-of-field blurring obtained withphysical lenses and sensors, then no bleeding should occur betweenobjects at well-separated distances from the sensor. In practice, a usermay wish to keep a slight amount of bleeding in order to set the flowerinto the background in the same way that slight shadows help set anobject in a scene. However, conventional blur tools do not providecontrols for the amount of bleeding.

Some conventional blur tools may provide techniques to prevent bleedingbetween distant objects, for example as specified by an input depthmask. This technique may provide physically sensible blurs, but does notprovide the user the desired level of creative control.

At least some embodiments of the blur module may implement a techniqueto aesthetically control the bleeding of blur introduced by blurringselections, referred to herein as a selection bleed technique.Embodiments of the selection bleed technique may enable continuousadjustment of the amount of bleeding of image blurs between a selectedimage region and its complement (the unselected region, e.g. thebackground). Embodiments of the selection bleed technique may allowselections to go from no-bleed to full-bleed via a percentage indicatedby one or more user interface elements, for example a slider.Controlling the bleeding of blur may, for example, be important to usersthat want to use blurring for automotive photography or similar types ofphotography, where sharp foreground is desired against a blurredbackground. More generally, the selection bleed technique can be used toprevent any color effects entering from neighboring regions, whileblurring the region of interest.

Embodiments of the selection bleed technique may provide user controlover the amount of blur-bleeding which occurs between selected andnon-selected image regions by enabling a continuous choice via the userinterface (e.g., via a slider bar). The user may select from 0% to 100%or any percentage in between (0.2%, 4.8%, 50%, and so on). Embodimentsof the selection bleed technique may, for example, be used with one ormore of the blur patterns provided by embodiments of a blur module asdescribed herein.

FIG. 18 is a high-level flowchart of a selection bleed technique,according to at least some embodiments. This method may, for example, beused to generate a blur effect in a portion of an input image asindicated by a selected region. As indicated at 1000, an indication of aselection region in the input image in which the blur effect is to beapplied and a variable bleed amount may be obtained, for example via auser interface as shown in FIG. 8. As indicated at 1010, the blur effectmay be applied to the input image according to the selection region. Anamount of color from outside the selection region that bleeds into colorinside the selection region is controlled by the bleed amount. In atleast some embodiments, the bleed amount is variable between 0% and100%; an amount of 0% results in no bleeding of color from outside theselection region into color inside the selection region, an amount of100% results in full bleeding of color from outside the selection regioninto color inside the selection region, and an amount between 0% and100% results in an intermediate amount of bleeding of color from outsidethe selection region into color inside the selection region. In at leastsome embodiments, distance from the border of the selection region towhich bleeding occurs is determined according to the blur radius at therespective pixels in the input image. The following describes theselection bleed technique as illustrated in FIG. 18 in more detail.

Selection Bleed Technique Implementation Details

The following provides implementation details for a selection bleedtechnique, according to at least some embodiments.

Let ‘image’ be the source image that is to be blurred. Let ‘fb’ be theselection bleed fraction that varies in the range between 0.0 and 1.0.And let ‘selection’ be the selection mask that also has values thatrange between 0.0 and 1.0. The selection bleed technique forms aselection blend mask (a blend of the selection mask with a uniformlyfully selected mask):

selection_blend=fb+(1−fb)*selection  (1)

which is the same as the selection mask when fb=0.0 and has a constantvalue of unity when fb=1.0.

Defining the blended image to be the product of the image with theselection blend mask:

blended_image=image*selection_blend,  (2)

the blurred, blended image can be produced by analogy with an alphapre-multiplication method. In the current notation, alpha is equivalentto the selection mask. The alpha-pre-multiplied image would be(image*selection). Blurring this image and undoing the multiplication bydividing by ‘selection’ at the very end, a blur may be produced whichdoes not bleed outside of the selection because the selection mask hasvalues of 0.0 in those regions. In order to produce a continuousgeneralization of this binary approach, at least some embodiments mayuse selection_blend instead of ‘selection’ to multiply the image, henceequation (2) above.

In at least some embodiments, rather than simply dividing byselection_blend after performing the blur of the blended_image, anadditional blend is added with the source image in order to obtainpleasing results:

blurred_blended_image=(1−selection_blend)*image+selection_blend*{Blur[blended_image]/selection_blend}  (3)

which is equivalent to

blurred_blended_image=(1−selection_blend)*image+Blur[blended_image]  (4)

For the special case in which no bleeding is desired, the bleedparameter (fb) is set to zero (fb=0), which results in:

selection_blend=selection

blended_image=image*selection

blurred_blended_image=(1−selection)*image+Blur[image*selection]

Note that inside the selected region, where ‘selection’ is unity, thisis just the blur of the image that takes no contributions from outsideof the selection, since it is the product (image*selection) that getsblurred.

On the other hand, for full bleeding, the bleed parameter (fb) is set tounity to obtain fb=1:

selection_blend=1

blended_image=image

blurred_blended_image=blur[image]

In other words, this reduces to just blending the entire image, ignoringany selections.

To illustrate an intermediate amount of bleeding, take the example wherefb=50% (fb=0.5):

selection_blend=(1+selection)/2

blended_image=image*(1+selection)/2

blurred_blended_image=0.5*(1−selection_blend)*image+Blur[image*0.5*(1+selection_blend)]

Selection Bleed and Blur Normalization

The following provides further discussion of the selection bleedtechnique, according to at least some embodiments.

Embodiments of a blur module may provide one or more types of spatiallyvarying blur patterns—e.g., field blur, iris blur and/or tilt-shiftblur. Each of these blur patterns may use a same or similar underlyingblurring algorithm which, in at least some embodiments, applies aspatially varying elliptical-kernel blur according to the values in theradius field (blur mask). A choice when applying a blur or any othersuch filter operation of non-unit spatial extent is the determination ofboundary conditions at the image edges. In at least some embodiments,the blur module handles these boundary conditions by employing an extranormalization plane that ensures that contributions to the blur frompixels near the image edges are appropriately weighted. In addition, inat least some embodiments, the blur module can be used with a selectionmask that controls, in a continuous fashion, which pixels are blurred.In many conventional blur tools, such as conventional Gaussian blurtools, the pixels within the selected region are blurred with imagevalue contributions from regions outside of the selection boundaries.The result is that colors from outside the selection will “bleed” intothe selected blurred region. In contrast to this behavior, embodimentsof the blur module may provides the user a choice, not only of whetheror not to allow this selection bleeding but, moreover, a continuouscontrol over how much selection bleeding should occur (see, e.g., FIGS.5A through 5E). Embodiments of the blur module, by using the selectionbleed technique described herein, may provide more freedom thanconventional blur tools by enabling a continuous control over the amountof bleeding.

This section outlines the logic behind these two blur modulations. Letthe image that is to be blurred (the source image) be designated as I₀.And let the spatially varying blur operation be denoted as B so that thebasic result of blurring the input image is represented as B I₀. Notethat an RGB color image contains three color planes. A grayscale imagewould contain a single plane and a CMYK image would contain four planes.

Consider first the case in which the selection encompasses the wholeimage; an alternative way of thinking of this is to say that there is noselection made; the whole image is used by default. In this case theblur module's blur B is produced by blurring both the image, I_(o), aswell as an additional normalization plane, N, which is the same size asthe image. The normalization plane is all white; it has image valueswhich are of unit value (for image intensity values scaled to range from0 to 1). The resultant blurred image, I_(blurred), is a ratio of theblur of the image planes to the blur of the unit normalization plane:

$\begin{matrix}{I_{blurred} = \frac{B\mspace{14mu} I_{0}}{B\mspace{14mu} N}} & (5)\end{matrix}$

For most of the image regions, the blur of an all-white image is againan all-white image; the denominator is unity and has no effect. However,near the image edges, where nearness is determined by the blur radii,there are contributions from outside the image boundary which must betaken into account. There are two options that could be used. The firstoption is to replicate the image edges when padding the image so thatthe values outside of the image are basically the edge values. If thatis done for the normalization plane as well, then the result isequivalent to blurring an edge-replicated image. This is the standardbehavior of many conventional blur tools such as a conventional Gaussianblur tool, and leads to excessive contributions from the edge pixels.The second option is to fill the regions outside of the image boundarywith values of zero. For this situation, there is no contribution frompixels outside of the boundary, neither from the numerator nor from thedenominator in the above formula (5). The result is equivalent toapplying a blur in which the contributions come only from pixels withinthe image boundary; the numerator containing the blur of thenormalization plane ensures that the contributions are properlyweighted. At least some embodiments of the blur module may use thesecond option. Note that this option is induced by the use of edgereplication to fill in intensity values for the horizontal integralimage (as opposed to the actual image itself) in the exterior paddedregions which extend outside of the image boundary; image valuesrepresented by differences of integral image values are then zero inthis exterior region. The effect of these two options can be seen inFIGS. 4A through 4E.

FIGS. 4A through 4E illustrate a normalization effect, according to atleast some embodiments. When a conventional Gaussian blur tool isapplied to this simple test image (FIG. 4A) the sliver of darker pixels(red, in a color image from which this grayscale image was produced) atthe left edge has an excessive effect as shown in 3B and 3C. In FIG. 4B,a conventional Gaussian blur, radius=10 pixels, was applied. In FIG. 4C,a conventional Gaussian blur, radius=100 pixels, was applied. Incontrast, FIGS. 4D and 4E show the result of applying the blur module'sfield blur tool, which reduces the contribution of the edge pixels. Thisis the result of the use of the additional normalization plane and theeffective zeroing out of contributions outside of the image boundary. InFIG. 4D, the field blur, radius=10 pixels, was applied. In FIG. 4E, thefield blur, radius=100 pixels, was applied.

Returning to the general case in which a selection contained within theimage is also present, the selection mask may be denoted by S, and thebleed fraction may be designated as β. To control the amount ofbleeding, a new image is formed by multiplying the original image by ablend of the selection mask with unity:

I _(0bleed-modulated)=[β+(1−β)S]I ₀

For the full 100% bleed situation (as with conventional Gaussian blur),β is 1 and the bleed-modulated image is the same as the original sourceimage. For the situation of no bleed, β is 0 and the original image ismultiplied by the selection mask. This selection blend multiplicationgives continuous control over the degree of bleeding from the bluroperations. This same factor is multiplied by the normalization plane togive:

N _(bleed-modulated)=[β+(1−β)S]N

and the final bleed-modulated blurred image is produced as:

$I_{blurred} = {\left( {1 - \left\lbrack {\beta + {\left( {1 - \beta} \right)S}} \right\rbrack} \right) + \frac{B\mspace{14mu} I_{0\mspace{14mu} {bleed}\text{-}{modulated}}}{B\mspace{14mu} N_{{bleed}\text{-}{modulated}}}}$

or, equivalently:

$I_{blurred} = {{\left( {1 - \beta} \right)\left( {1 - S} \right)} + \frac{B\mspace{14mu} I_{0\mspace{14mu} {bleed}\text{-}{modulated}}}{B\mspace{14mu} N_{{bleed}\text{-}{modulated}}}}$

For the full bleed limit, β=1, which reduces to:

$I_{blurred} = \frac{B\mspace{14mu} I_{0}}{B\mspace{14mu} N}$

which is the same as ignoring the selection (the above-mentioned case inwhich the selection encompasses the entire image); and for the no-bleedlimit, β=0, this becomes:

$I_{blurred} = {{\left( {1 - S} \right)I_{0}} + \frac{B\mspace{14mu} S\mspace{14mu} I_{0}}{B\mspace{14mu} S\mspace{14mu} N}}$

In the latter case, the blurring only has contributions from within theselection. The results for values of S that lie intermediate between 0.0and 1.0 could be varied, but the empirically derived formula works well.

FIGS. 5A through 5E and FIGS. 6A through 6D illustrate controlling theselection bleeding in embodiments of the blur module that implement theselection bleed technique. FIGS. 5A through 5E illustrate the selectionbleed technique, according to at least some embodiments. FIGS. 5A and 5Bshow the original image and the original image with a selection of thesky, respectively. FIG. 5C depicts a field blur applied with fullbleeding specified; a conventional Gaussian blur tool would produce asimilar result. The bleeding of the cactus colors into the selected skyis evident. In FIG. 5C, the field blur tool has been applied with a blurradius of 25 pixels and full strength (100%) selection bleeding. Incontrast to FIG. 5C, FIG. 5D shows the same image with the selectionbleed amount reduced to 0%. There is now no bleeding of green into theselected blue regions. In FIG. 5D, the field blur tool has been appliedwith a blur radius of 25 pixels and 0% selection bleeding (no bleeding).In FIG. 5E, the field blur tool has been applied with a blur radius of25 pixels and 20% selection bleeding. The slight bleeding adds a slightsoftness at the edge of the selection.

FIGS. 6A through 6D illustrate another image with varying amounts ofselection bleed specified for the field blur, according to at least someembodiments. FIG. 6A shows 100% selection bleed, and shows the selectionand field blur pins. FIG. 6B shows 50% selection bleed, FIG. 6C 25%selection bleed, and FIG. 6D shows 0% selection bleed. Note that thedifference between 0% (FIG. 6D) and 25% (FIG. 6C) selection bleed issubtle when viewed side by side (as opposed to when superposed on top ofeach other). A difference image (not shown) between FIGS. 6D and 6C,which may be generated using a difference blend mode, would reveal theareas of bleeding more clearly: This difference image could serve in itsown right to add a creative element, for example by combining thedifference image with the 25% bleed image of FIG. 6C.

Bokeh Techniques

Embodiments of a method and apparatus for creating bokeh effects indigital images are described. Embodiments of a bokeh technique aredescribed that may provide double threshold image bokeh boosting withoptional bokeh colorfulness adjustments.

Bokeh is a characteristic of the aperture shape of the lens, and bokeheffects may appear in images, for example, when shooting dark sceneswith bright light sources (usually at a distance). Embodiments of thebokeh technique as described herein may achieve this creative effect bysimulating bokeh in the resultant blurred image. This bokeh techniquemay be used in embodiments of the blur module as described herein,either alone or in addition to one or more of the blur patterns (e.g.,field blur, iris blur and tilt-shift blur).

Conventional techniques only allow for a single threshold to specifywhich pixel values should be considered as sparkles (light sources).Embodiments of the bokeh technique may provide the flexibility to choosefrom a range of values by using two thresholds (an upper and lowerthreshold that specify a light range). Conventional techniques may alsohave a hard threshold that can give unnatural effects. Embodiments ofthe bokeh technique may implement a soft threshold (e.g., using aweighting function) to determine the light range from the upper andlower thresholds. In addition to this creative effect, at least someembodiments of the bokeh technique may also allow a notion ofcolorfulness of the bokeh, which provides a continuous variation from arealistic bokeh (what can be expected from a real camera) to a moreartistic colorful bokeh.

In embodiments of the bokeh technique, specular highlights in images(e.g., digital or digitized photographs, digital or digitized videoframes, or even synthesized images) may be boosted, not simply with theconventional method of preferentially boosting high intensity pixelintensities as determined by a user-specified threshold intensityamount, but instead with a more flexible approach based upon twointensity threshold inputs. At least some embodiments of the bokehtechnique may also include methods and user interface elements thatimplement a bokeh colorfulness control technique that enables thecontinuous selection of colorfulness values for boosted bokeh regions.

Embodiments of the bokeh technique may thus provide more flexible,creative methods of modifying an image, enabling the user to createboosted lens bokehs for any tonal region of an image. Along with thebokeh colorfulness control, the bokeh technique thus providesnon-physical creative possibilities that are not provided inconventional techniques.

The optical process of blurring an image formed on a camera sensorinvolves spreading light intensities from scene point sources ontonon-localized regions of the sensor. For a camera lens whose plane isparallel to the sensor plane, the spreading may be produced as astamping of the lens aperture shape onto surrounding pixel regions,modulated by various optical effects such as light diffraction,reflections, geometrical factors, etc. Typically, this stamping producesa blurry image, which at a casual glance does not display the apertureshape unless there are small, very bright regions of the image setagainst darker background regions of the image. For physicalcamera/sensor systems the high dynamic range of real physical scenespresents many such examples, such as a bright lamp at night or the glintof the sun off of a metallic object.

A scene may be captured which is totally or partially in focus. Specularhighlights captured from such scenes, when blurred, may produce the lensaperture bokeh stamped shapes. While there is no consistent term forsuch shapes in the art, these shapes may be referred to herein assparkles. If the sparkle source (a specular highlight) is not blurredand thus appears in-focus on the sensor plane, the sparkles may beproduced after the image is captured (post-processing) if the image iscaptured as a high dynamic range (HDR) image.

However, for non-HDR images, these sparkles may be produced bysimulating an HDR image from a non-HDR source image. This can be thoughtof as a problem of inverse tone mapping. Tone mapping is the process ofmapping (taking a function of) the HDR image intensity values to producenon-HDR values. Inverse tone mapping is then the process of simulatingthe lost HDR intensities form the non-HDR intensities. For example, withan 8-bit image, the possible image intensities range in value from 0 to255. When a sensor is inundated with light intensities that would mapoutside of the maximum intensity value of 255, those inundated valuesare typically clipped to the maximum value of 255; thus, information islost. However, simulated inverse tone mapping may be applied to make aninformed guess as to what the high intensity values were.

Conventional techniques that apply bokeh boosting make this guess bysimply boosting the brightest intensity values in the image. Differentconventional techniques use different methods of tailoring the functionthat applies the boost; however, the conventional techniques depend uponthe presence of a single threshold intensity value. The cutoff may behard or soft, but basically intensity values greater than the thresholdamount get boosted and values less than the threshold do not (or may getboosted to a lesser extent).

Embodiments of the bokeh technique described herein release theconnection with physical bokeh boosting and enable boosting of imageintensities for any tonal region of the image as specified by twoseparate threshold values. In general, using the two threshold values,intensity values within a light range determined by the two thresholdvalues (greater than the lower threshold and less than the upperthreshold) are boosted, and values outside the light range are notboosted. For example, given a pixel value range of 0 to 255,conventional methods may allow a single threshold to be set, for exampleto 200 or 252, which results in intensity values greater than 200 or 252being boosted. Unlike conventional techniques, embodiments of the bokehtechnique described herein allow a lower and upper threshold to bespecified, for example a lower threshold value of 0 and an upperthreshold value of 100, or a lower threshold value of 190 and an upperthreshold value of 210, and so on, which results in intensity valuesbeing boosted between the two threshold. Thus, the two threshold valuesmay allow the user to specify boosting of image intensities for anytonal region or range of the image.

In at least some embodiments, a soft threshold technique may be appliedto determine the light range for the bokeh effect according to the twospecified threshold values. Using the soft threshold technique, aparticular functional shape of the intensity boost function may bedetermined by the two thresholds; however, instead of a hard limit atthe two thresholds, smooth or soft threshold edges are determinedaccording to the two specified thresholds, for example by applying aweighting function. Using the soft threshold technique, most, but notall, of the energy in the function fits between the two thresholds. See,e.g., FIGS. 7A through 7C.

In addition, at least some embodiments enable control of thecolorfulness of the bokeh sparkles thus generated via a user-specifiedcolorfulness value, for example within a range of 0% (natural color) to100% (fully boosted colorfulness).

FIG. 19 is a high-level flowchart of a bokeh technique, according to atleast some embodiments. This technique may, for example, be used togenerate a bokeh effect in a blur region of an input image. As indicatedat 1100, input indicating a boost amount for the bokeh effect, an upperthreshold value, and a lower threshold value, may be obtained. The upperand lower threshold values indicate a light range for the bokeh effect.In at least some embodiments, the upper threshold value and the lowerthreshold value are each variable within a range from a minimumintensity value to a maximum intensity value. As indicated at 1110, thebokeh effect is applied within the blur region of the image by boostingintensity of specular highlights in the image according to the boostamount and the light range. The specular highlights within the image towhich the bokeh effect is applied are determined according to the lightrange.

In at least some embodiments, the bokeh input further specifies acolorfulness value that controls color saturation of boosted pixels.Colorfulness may be added to the bokeh effect applied to the specularhighlights according to the specified colorfulness value. In at leastsome embodiments, adding colorfulness is performed applying the boostingindependently to each color channel of the boosted pixels in thespecular highlights according to the colorfulness value.

In at least some embodiments, a soft threshold is determined for thelight range according to a weighting function applied to the upper andlower threshold values.

The soft threshold for the light range results in most but not allenergy of the boosting of the intensity falling between the upper andlower threshold values.

Bokeh Technique Implementation Details

This section provides details of the bokeh technique, according to atleast some embodiments. The section describes example algorithms thatmay be used in the bokeh technique, according to at least someembodiments, and are not intended to be limiting.

Let s be the source image pixel intensity value for some pixel. Theboosted source intensity value, referred to herein as boosted_s, may bedetermined predominantly from input values including, but not limitedto:

-   -   boost_factor (boost amount), which controls the maximum boost        for image intensities (and thus how bright the sparkles will        be);    -   boost_threshold_low and boost_threshold_high, which determine        the tonal region (or light range) of the image which will get        boosted; and    -   colorfulness, which controls the color saturation of pixels        which do get boosted.

An example algorithm to determine boosted_s according to the above inputvalues follows. Note that the following algorithm is given by way ofexample, and is not intended to be limiting. Comments are shown bydouble slashes (“//”):

-   -   lightness=(1.0−colorfulness)*luminance+colorfulness*s;    -   phi1=<lightness) ? power (k12*(lightness−I1), beta1): 0.0;    -   phi2=(lightness<_I2) ? power (k12*(_I2−lightness),beta2): 0.0;    -   //normalize to ensure that the maximum value of bump is 1.0    -   bump=normalization*phi1*phi2;    -   boosted_s=s*(1+boost_factor*bump);

In at least some embodiments, normalization and other constants may bedetermined by:

-   -   beta_max=3; //controls skew of thresholded tonal ranges    -   kappa=2; //controls tightness of thresholded tonal ranges    -   I1=min (boost_threshold_low, boost_threshold_high);    -   I2=max (boost_threshold_low, boost_threshold_high);    -   k12=(I1 !=I2) ? 1.0/abs(I2−I1):0.0;    -   beta1=beta_max*exp(−kappa*(1.0−12));    -   beta2=beta_max*exp (−kappa*I1);    -   normalization=power (beta1+beta2, beta1+beta2)/(power (beta1,        beta1)*power (beta2, beta2));

Note that the above algorithm is given by way of example, and is notintended to be limiting. In at least some embodiments, thisnormalization may be chosen so that the maximum value of the above bumpfunction is 1.0. Note that the lightness amount may be controlled by thebokeh colorfulness parameter.

FIGS. 7A through 7C show example graphs that illustrate boosting,according to at least some embodiments. The graphs each show boostedsource intensity as a function of original source intensity. In thegraphs, I′=boosted_s (boosted source intensity) and is plotted on thevertical axis; s (original source intensity) is plotted on thehorizontal axis. As indicated above, I1=min (boost_threshold_low,boost_threshold_high), and I2=max (boost_threshold_low,boost_threshold_high). In the graph of FIG. 7A, I1=0.5, and I2=1.0. Inthe graph of FIG. 7B, I1=0.3, and I2=0.7. In the graph of FIG. 7C,I1=0.0, and I2=0.5.

User Interface

Embodiments of the blur module render physically-realistic,spatially-varying blurs in digital images while at the same time givingusers the flexibility to produce creative blur effects not provided inconventional blurring techniques via an interface to the blur module. Atleast some embodiments of the blur module may provide three differenttypes of blur patterns, referred to herein as field blur, iris blur andtilt-shift. Each different type of blur pattern can be combined with oneor more of the other blur patterns non-destructively to create variousblur effects. At least some embodiments may also provide a bokeh effectthat may be combined with or more of the blur patterns. Each blurpattern has a corresponding on-canvas user interface element or elements(e.g., a widget and/or one or more sliders, check boxes, text entryboxes, and/or other user interface elements) that can be manipulated fora live preview. User interface elements are also provided forselectively applying and controlling the bokeh effect.

In at least some embodiments, an intuitive on-canvas (i.e. displayed onthe target image) widget is provided via the user interface for eachtype of blur pattern. In at least some embodiments, each widget mayinclude or provide one or more control elements that can be used tocontrol various parameters such as position, amount of blur, amount offeather, etc. Using embodiments, a user can generate multiple instancesof a given blur pattern (i.e., multiple widgets). In addition, one ormore instances of a given blur pattern may be combined with one or moreinstances of a different blur pattern, and the other blur patterns maybe combined with these instances as well. Thus, field blur, iris blurand/or tilt-shift widgets may be combined and manipulated, for exampleby the respective widgets, in a single image as the user desires toachieve a wide variety of combined blur patterns. In addition, in atleast some embodiments, a bokeh effect is provided that may be combinedwith or more of the other blur patterns.

FIG. 8 illustrates an example user interface to a blur module, accordingto at least some embodiments. The user interface (UI) 200 is given byway of example, and is not intended to be limiting. UI 200 may includeat least a target image, or canvas, 202 in which the target image isdisplayed. The UI 200 may also include a blur controls 220 area thatincludes at least field blur controls 222, iris blur controls 224,tilt-shift blur controls 226, and bokeh effect controls 228. Each offield blur controls 222, iris blur controls 224, tilt-shift blurcontrols 226, and bokeh effect controls 228 may include a checkbox orother UI element that enables the user to turn on or off the respectiveblur pattern. Each of field blur controls 222, iris blur controls 224,tilt-shift blur controls 226, and bokeh effect controls 228 may alsoinclude one or more UI elements that allows the user to show or hide therespective controls. Each of field blur controls 222, iris blur controls224, tilt-shift blur controls 226, and bokeh effect controls 228 mayalso include one or more UI elements (e.g., slider bars, text entryboxes, check boxes, pop-up menus, etc.) that allow the user to controlone or more parameters of the respective blur pattern.

UI elements (e.g., widgets and pins) may also be added to, displayed on,and manipulated in the canvas 202. For example, one or more pins 212 (inthis example an iris blur pin 212A, a tilt-shift blur pin 212B, and twofield blur pins 212C and 212D) may be added to and manipulated on thecanvas 202 for at least some of the blur patterns, for example the fieldblur pattern. In addition, the user may select a pin 212 (or a locationto add another pin); selecting or adding a pin 212 may cause a widgetfor a respective or current blur pattern to be displayed for the pin212. The widget may include handles or other controls that the user maygrab and manipulate via a cursor control device (e.g., a mouse, or astylus or finger on touch-enabled devices) to modify parameters of therespective blur pattern. In at least some embodiments, the widget foreach type of blur pattern (field blur, iris blur, and tilt-shift blur)may include a focus control ring 210 that may be used to control theblur amount. For example, rotating a handle on the focus control ring210 may increase or decrease the blur amount setting of the respectiveblur pattern. Not that manipulating the widget may result in changes inthe user interface elements for the respective blur pattern in blurcontrols 220 area. Similarly, manipulating the user control elements inblur controls 220 area may result in changes to a respective widget.

In addition to a focus control ring 210, parameters of some blurpatterns may be indicated by other user interface elements in therespective widget. For example, an iris blur widget may include an irisblur ellipse 214 that indicates an outer boundary of the iris blurpattern. In at least some embodiments, the user may grab and adjust theiris blur ellipse 214 via the cursor control device (for example, at oneof the ellipse control points) to expand, shrink, and/or stretch theellipse 214, to change the shape of the ellipse (e.g., to a morerectangular (non-elliptical) shape), and/or to rotate the ellipse.Alternatively, other techniques may be provided to cause the ellipse 214to expand, contract, change shape, rotate, and/or stretch. In addition,an iris blur widget may include one or more feather controls that may bemanipulated by the user to control the inner boundary of the iris blur.The iris blur is “feathered” between the inner boundary indicated bythese feather controls and the ellipse 214. The region inside the innerboundary is not blurred; the region outside the ellipse 214 is blurredaccording to the blur amount, and the region in between varies smoothlyfrom not blurred at the inner boundary to blurred at the outer boundary.As another example, two or more bars 216 may be displayed as part of thetilt-shift blur widget to indicate ranges of the tilt-shift blurpattern. The bars 216 may be moved relative to each other and/orrelative to the respective pin for the tilt-shift blur instance,rotated, and so on via the mouse or other control device. In at leastsome embodiments, no (zero) blur may be applied within the inner bars, amaximum blur may be applied outside the outer bars, and the blur patternmay be feathered between the inner bars and outer bars, from zero at theinner bars to maximum at the outer bars.

In at least some embodiments, UI 200 may include one or more UI elementsfor selecting regions (selections) for the selection bleed technique asdescribed herein. In at least some embodiments, UI 200 may include ableed control UI element (e.g., a bleed control slider bar and text boxas shown in FIG. 8) that allows the user to control the amount of bleedfor a selection within the range of 0% (no bleed) and 100% (full bleed).

UI 200 may include one or more other UI elements that are not shown, forexample UI elements to commit the current blur settings to the image,save a current canvas, save current settings of the UI controls and UIelements, undo previous actions, repeat previous actions, open newimages, select other tools, and so on.

In at least some embodiments, the various UI elements in FIG. 8 may beapplied to an image to generate one or more instances of each of the oneor more blur patterns, and to apply bokeh as desired to the image. Thecurrent settings of the UI may be saved, and may then be applied to oneor more other images via the UI 200. Alternatively, a current image maybe closed (potentially saving the changes to the image), and anotherimage may be opened in the canvas 202 with the current blur settingsapplied to the newly opened image.

FIGS. 20, 21, and 22 provide more details of the field blur UI, the irisblur UI, and the tilt-shift blur UI, respectively.

FIGS. 9A-9C, 11A-11H, 12A-12B, 13A-13B, 14A-14C, 15A-15D, and 16A-16Dillustrate applying the various blur patterns, including field blur,iris blur, tilt-shift blur, and bokeh, to example images using theexample UI 200 illustrated in FIG. 8, according to at least someembodiments. Each of these Figures shows a UI region similar to the blurcontrols 220 area of FIG. 8, as well as various widgets for therespective blur patterns. However, note that the UIs shown in theseFigures are not intended to be limiting. Note that the UI may includeother UI elements not shown in these Figures, for example a bleedcontrol UI element (e.g., a bleed control slider bar and text boxsimilar to that shown in FIG. 8) that allows the user to control theamount of bleed for a selection within the range of 0% (no bleed) and100% (full bleed).

FIGS. 9A-9C illustrate applying iris blur to an example image, accordingto at least some embodiments. FIG. 9A shows the image, with the widget210 active at a first pin 212 and the iris blur ellipse 214 displayed onthe canvas 202. Note that the bokeh effect is also selected. Currentsettings for the iris blur controls 222 and bokeh controls 228 are shownin the blur controls 220 area. The blur amount for the iris blur patternis set to 60 pixels. Light bokeh is set to 25%, bokeh color to 0%, andthe light ranges is 191-255. The four small circles within the ellipse214 may be UI elements (e.g., feather control elements) that may also bemanipulated by the user to control the iris blur pattern. FIGS. 9B and9C show a mask of the iris blur pattern at the pins, with the widget 210at a first pin in the FIG. 9B, and at a second pin in FIG. 9C.

FIGS. 11A-11H illustrate applying tilt-shift blur to an example image,according to at least some embodiments. FIG. 11A shows the image, withthe widget 210 active at a pin 212 and the tilt-shift bars 216 displayedon the canvas 202. Note that the bokeh effect is also selected. Currentsettings for the tilt-shift controls 224 and bokeh controls 228 areshown in the blur controls 220 area. Note that bokeh settings are at 0%.

FIG. 11B shows a mask for the tilt-shift blur of FIG. 11A. FIG. 11Cshows a mask with multiple (two, in this example) instances of thetilt-shift blur. Each instance is indicated by a pin. In this example,the more vertical of the two tilt-shifts is currently selected, with thewidget 210 displayed at the respective pin, and the respectivetilt-shift bars 216 displayed. The tilt-shift controls 224 indicate thesettings for the select tilt-shift instance.

FIG. 11D shows the image, with the widget 210 active at a pin 212 andthe respective tilt-shift bars 216 displayed on the canvas 202. Notethat the bokeh effect is also selected. Current settings for thetilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. In this example, light bokeh is set to 67%, andsymmetric distortion is selected in controls 228 with the distortionvalue set to maximum positive distortion (100%). Note that the“sparkles” at the light points resulting from application of the bokeheffect are elliptical, with the major axes of the ellipses pointingtowards the tilt-shift pin.

FIG. 11E shows the image, with the widget 210 active at a pin 212 andthe respective tilt-shift bars 216 displayed on the canvas 202. Notethat the bokeh effect is also selected. Current settings for thetilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. In this example, light bokeh is set to 60%, andsymmetric distortion is selected in controls 228 with the distortionvalue set to maximum negative distortion (−100%). Note that the“sparkles” at the light points are elliptical, with the major axes ofthe ellipses orthogonal to the tilt-shift pin.

FIG. 11F shows the image, with the widget 210 active at a pin 212 andthe respective tilt-shift bars 216 displayed on the canvas 202. Notethat the bokeh effect is also selected. Current settings for thetilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. In this example, light bokeh is set to 60%, andsymmetric distortion is selected in controls 228 with the distortionvalue set to no distortion (0%).

FIG. 11G shows the image, with the widget 210 active at a pin 212 andthe respective tilt-shift bars 216 displayed on the canvas 202. Notethat the bokeh effect is also selected. Current settings for thetilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. In this example, light bokeh is set to 55%, bokehcolor is set to 2%, and symmetric distortion is selected in controls 228with the distortion value set to no distortion (0%). Setting bokeh colorabove 0% adds “colorfulness” to the bokeh effect.

FIG. 11H shows the image, with the widget 210 active at a pin 212 andthe respective tilt-shift bars 216 displayed on the canvas 202. Notethat the bokeh effect is also selected. Current settings for thetilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. In this example, light bokeh is set to 55%, bokehcolor is set to 58%, and symmetric distortion is selected in controls228 with the distortion value set to no distortion (0%). The“colorfulness” of the bokeh effect is more pronounced in this image thanin the image of FIG. 11G.

FIGS. 12A and 12B illustrate applying field blur to an example image,according to at least some embodiments. FIG. 12A shows the image, withthe widget 210 active at a first pin 212 on the canvas 202. Note thatthe bokeh effect is also selected, with the light bokeh value set to62%. Current settings for the field blur controls 222 and bokeh controls228 are shown in the blur controls 220 area. FIG. 12B shows a mask ofthe field blur pattern according to the current settings of the pins.Note that each pin can be selected to adjust the field blur parameter(s)at the pin. In addition, pins may be moved, added, or deleted.

FIGS. 13A and 13B illustrate manipulating the light range of an irisblur in an example image, according to at least some embodiments. FIGS.13A and 12B show the image, with the widget 210 active at a pin 212 andthe iris blur ellipse 214 displayed on the canvas 202. Note that thebokeh effect is also selected. Current settings for the iris blurcontrols 222 and bokeh controls 228 are shown in the blur controls 220area. In FIG. 13A, light bokeh is set to 60%, and the light range is setto a wide range (96-255). In FIG. 13B, light bokeh is set to 60%, andthe light range is set to a narrow range (96-97).

FIGS. 14A-14C illustrate applying multiple blur patterns to an image,according to at least some embodiments. In these Figures, only the maskis shown. FIG. 14A shows the field blur selected and applied, with fourpins indicating the field blur. The field blur may be manipulated, forexample via a widget, at each field blur pin. FIG. 14B illustratesadding an iris blur pattern to the image of FIG. 14A. The iris blur maybe manipulated, for example via a widget at the iris blur pin. FIG. 14Cillustrates adding a tilt-shift blur pattern to the image of FIG. 14B.The tilt-shift blur may be manipulated, for example via a widget at thetilt-shift blur pin. As can be seen in the masks in FIGS. 14A-14C, thevarious blur patterns may be combined and manipulated and areappropriately blended to achieve a unique, creative blur mask.

FIGS. 15A-15D illustrate applying field blur and bokeh to an exampleimage, according to at least some embodiments. FIG. 15A shows the image,with the widget 210 active at a center pin 212 of three pins on thecanvas 202. Note that the bokeh effect is also selected at the pin, withthe light bokeh value set to 43%. Current settings for the field blurcontrols 222 and bokeh controls 228 are shown in the blur controls 220area. FIG. 15B shows the image with “colorfulness” added to the fieldblur pattern. In this example, light bokeh is set to 51, and bokeh coloris set to 100% at the selected pin. Note that a relatively narrow lightrange (184-208) has been set in both FIGS. 15A and 15B.

FIG. 15C shows a mask of the field blur pattern according to the currentsettings of the pins. Note that each pin can be selected to adjust thefield blur parameter(s) at the pin. In addition, pins may be moved,added, or deleted.

FIG. 15D shows the image of FIGS. 15A and 15B, with field blur on.However, in this example, the bokeh effect has been turned off bydeselecting the check box in the bokeh effect controls 228.

FIGS. 16A-16D illustrate applying tilt-shift blur to an example image,according to at least some embodiments. FIG. 16A shows the image, withthe widget 210 active at a pin 212 and the tilt-shift bars 216 displayedon the canvas 202. Note that the bokeh effect is also selected, but thelight bokeh and bokeh color values are set to 0%. Current settings forthe tilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. FIG. 16B shows a mask for the tilt-shift blur of FIG.16A.

FIGS. 16C and 16D illustrate applying multiple tilt-shift blurs to animage, according to at least some embodiments. FIG. 16C shows the image,with the widget 210 active at a currently selected pin 212 and therespective tilt-shift bars 216 displayed on the canvas 202. The pin ofthe second tilt-shift instance can be seen on the right of the image.The two pins can be independently selected to adjust the respectivetilt-shift pattern. Note that the bokeh effect is also selected, but thelight bokeh and bokeh color values are set to 0%. Current settings forthe tilt-shift controls 224 and bokeh controls 228 are shown in the blurcontrols 220 area. FIG. 16D shows a mask for the tilt-shift blur of FIG.16C.

Example Implementations

Some embodiments may include means for performing the various blurtechniques described herein, including the field blur, iris blur,tilt-shift blur, bokeh effect, and the selection bleed technique. Forexample, a blur module may receive input identifying, or otherwiseobtain, a digital image on which one or more of the blur techniques asdescribed herein is to be performed. The blur module may receiveadditional input via a user interface (e.g., UI 200 shown in FIG. 8)indicating application of one or more of the blur techniques to thedigital image as described herein. Note that any two or more of the blurtechniques may be combined. The blur module may in some embodiments beimplemented by a non-transitory, computer-readable storage medium andone or more processors (e.g., CPUs and/or GPUs) of a computingapparatus. The computer-readable storage medium may store programinstructions executable by the one or more processors to cause thecomputing apparatus to perform one or more of the blur techniques asdescribed herein. Other embodiments of the blur module may be at leastpartially implemented by hardware circuitry and/or firmware stored, forexample, in a non-volatile memory.

FIG. 23 illustrates a blur module that may implement one or more of theblur techniques and tools illustrated in FIGS. 1 through 22. Module 1900may, for example, implement one or more of a field blur tool, an irisblur tool, a tilt-shift blur tool, and a bokeh tool. In someembodiments, module 1900 may also implement a selection bleed techniqueas previously described. FIG. 24 illustrates an example computer systemon which embodiments of module 1900 may be implemented. Module 1900receives as input one or more digital images 1920, and displays theimage on a working canvas 1904. The image 1920 may be a digital ordigitized photograph, a digital or digitized video frame, or even asynthesized image. Module 1900 may receive user input 1922 via userinterface 1902 selecting a blur tool. Module 1900 then edits the workingcanvas 1904 according to additional user input 1922 received via userinterface 1902, using the current blur tool, to add and adjust blurpatterns to the working canvas 1904. The user may activate a differentblur tool via user interface 1902 and further edit the image to applyadditional blur patterns. Module 1900 generates as output one or moremodified images 1930. Output image(s) 1930 may, for example, be storedto a storage medium 1940, such as system memory, a disk drive, DVD, CD,etc., displayed to a display device 1940, and/or provided to one or moreother modules 1950 for additional digital image processing.

Embodiments of the blur module or one or more of the blur tools andtechniques as described herein may be implemented as a plug-in forapplications, as library functions, and/or as a stand-alone application.Embodiments of the blur module or one or more of the blur tools andtechniques as described herein may be implemented in any imageprocessing application, including but not limited to Adobe® PhotoShop®Adobe® PhotoShop® Elements®, and Adobe® After Effects®. Adobe,PhotoShop, PhotoShop Elements, and Adobe After Effects are eitherregistered trademarks or trademarks of Adobe Systems Incorporated in theUnited States and/or other countries.

Example System

Embodiments of the blur module and/or one or more of the blur tools andtechniques as described herein may be executed on one or more computersystems, which may interact with various other devices. One suchcomputer system is illustrated by FIG. 24. In different embodiments,computer system 2000 may be any of various types of devices, including,but not limited to, a personal computer system, desktop computer,laptop, notebook, or netbook computer, mainframe computer system,handheld computer, workstation, network computer, a camera, a set topbox, a mobile device, a consumer device, video game console, pad ortablet device, smart phone, handheld video game device, applicationserver, storage device, a peripheral device such as a switch, modem,router, or in general any type of computing or electronic device.

In the illustrated embodiment, computer system 2000 includes one or moreprocessors 2010 coupled to a system memory 2020 via an input/output(I/O) interface 2030. Computer system 2000 further includes a networkinterface 2040 coupled to I/O interface 2030, and one or moreinput/output devices 2050, such as cursor control device 2060, keyboard2070, and display(s) 2080. In at least some embodiments, a touch- ormultitouch-enabled device 2090 may be included, and may be used toperform at least some of the UI functions as described above for thevarious blur techniques. In some embodiments, it is contemplated thatembodiments may be implemented using a single instance of computersystem 2000, while in other embodiments multiple such systems, ormultiple nodes making up computer system 2000, may be configured to hostdifferent portions or instances of embodiments. For example, in oneembodiment some elements may be implemented via one or more nodes ofcomputer system 2000 that are distinct from those nodes implementingother elements.

In various embodiments, computer system 2000 may be a uniprocessorsystem including one processor 2010, or a multiprocessor systemincluding several processors 2010 (e.g., two, four, eight, or anothersuitable number). Processors 2010 may be any suitable processor capableof executing instructions. For example, in various embodiments,processors 2010 may be general-purpose or embedded processorsimplementing any of a variety of instruction set architectures (ISAs),such as the x86, PowerPC, SPARC, or MIPS ISAs, or any other suitableISA. In multiprocessor systems, each of processors 2010 may commonly,but not necessarily, implement the same ISA.

In some embodiments, at least one processor 2010 may be a graphicsprocessing unit. A graphics processing unit or GPU may be considered adedicated graphics-rendering device for a personal computer,workstation, game console or other computing or electronic device.Modern GPUs may be very efficient at manipulating and displayingcomputer graphics, and their highly parallel structure may make themmore effective than typical CPUs for a range of complex graphicalalgorithms. For example, a graphics processor may implement a number ofgraphics primitive operations in a way that makes executing them muchfaster than drawing directly to the screen with a host centralprocessing unit (CPU). In various embodiments, the image processingmethods disclosed herein may, at least in part, be implemented byprogram instructions configured for execution on one of, or parallelexecution on two or more of, such GPUs. The GPU(s) may implement one ormore application programmer interfaces (APIs) that permit programmers toinvoke the functionality of the GPU(s). Suitable GPUs may becommercially available from vendors such as NVIDIA Corporation, ATITechnologies (AMD), and others.

System memory 2020 may be configured to store program instructionsand/or data accessible by processor(s) 2010. In various embodiments,system memory 2020 may be implemented using any suitable memorytechnology, such as static random access memory (SRAM), synchronousdynamic RAM (SDRAM), nonvolatile/Flash-type memory, or any other type ofmemory. In the illustrated embodiment, program instructions and dataimplementing desired functions, such as those described above forembodiments of a blur module and/or one or more of the blur tools andtechniques as described herein are shown stored within system memory2020 as program instructions 2025 and data storage 2035, respectively.In other embodiments, program instructions and/or data may be received,sent or stored upon different types of computer-accessible media or onsimilar media separate from system memory 2020 or computer system 2000.Generally speaking, a computer-accessible medium may include storagemedia or memory media such as magnetic or optical media, e.g., disk orCD/DVD-ROM coupled to computer system 2000 via I/O interface 2030.Program instructions and data stored via a computer-accessible mediummay be transmitted by transmission media or signals such as electrical,electromagnetic, or digital signals, which may be conveyed via acommunication medium such as a network and/or a wireless link, such asmay be implemented via network interface 2040.

In one embodiment, I/O interface 2030 may be configured to coordinateI/O traffic between processor(s) 2010, system memory 2020, and anyperipheral devices in the device, including network interface 2040 orother peripheral interfaces, such as input/output devices 2050. In someembodiments, I/O interface 2030 may perform any necessary protocol,timing or other data transformations to convert data signals from onecomponent (e.g., system memory 2020) into a format suitable for use byanother component (e.g., processor(s) 2010). In some embodiments, I/Ointerface 2030 may include support for devices attached through varioustypes of peripheral buses, such as a variant of the Peripheral ComponentInterconnect (PCI) bus standard or the Universal Serial Bus (USB)standard, for example. In some embodiments, the function of I/Ointerface 2030 may be split into two or more separate components, suchas a north bridge and a south bridge, for example. In addition, in someembodiments some or all of the functionality of I/O interface 2030, suchas an interface to system memory 2020, may be incorporated directly intoprocessor(s) 2010.

Network interface 2040 may be configured to allow data to be exchangedbetween computer system 2000 and other devices attached to a network,such as other computer systems, or between nodes of computer system2000. In various embodiments, network interface 2040 may supportcommunication via wired or wireless general data networks, such as anysuitable type of Ethernet network, for example; viatelecommunications/telephony networks such as analog voice networks ordigital fiber communications networks; via storage area networks such asFibre Channel SANs, or via any other suitable type of network and/orprotocol.

Input/output devices 2050 may, in some embodiments, include one or moredisplay terminals, keyboards, keypads, touchpads, scanning devices,voice or optical recognition devices, or any other devices suitable forentering or retrieving data by one or more computer system 2000.Multiple input/output devices 2050 may be present in computer system2000 or may be distributed on various nodes of computer system 2000. Insome embodiments, similar input/output devices may be separate fromcomputer system 2000 and may interact with one or more nodes of computersystem 2000 through a wired or wireless connection, such as over networkinterface 2040.

As shown in FIG. 24, memory 2020 may include program instructions 2025,configured to implement embodiments of a blur module and/or one or moreof the blur tools and techniques as described herein as describedherein, and data storage 2035, comprising various data accessible byprogram instructions 2025. In one embodiment, program instructions 2025may include software elements of embodiments of a the blur module and/orone or more of the blur tools and techniques as described herein asillustrated in the above Figures. Data storage 2035 may include datathat may be used in embodiments. In other embodiments, other ordifferent software elements and data may be included.

Those skilled in the art will appreciate that computer system 2000 ismerely illustrative and is not intended to limit the scope of a the blurmodule and/or one or more of the blur tools and techniques as describedherein as described herein. In particular, the computer system anddevices may include any combination of hardware or software that canperform the indicated functions, including a computer, personal computersystem, desktop computer, laptop, notebook, or netbook computer,mainframe computer system, handheld computer, workstation, networkcomputer, a camera, a set top box, a mobile device, network device,internet appliance, PDA, wireless phones, pagers, a consumer device,video game console, handheld video game device, application server,storage device, a peripheral device such as a switch, modem, router, orin general any type of computing or electronic device. Computer system2000 may also be connected to other devices that are not illustrated, orinstead may operate as a stand-alone system. In addition, thefunctionality provided by the illustrated components may in someembodiments be combined in fewer components or distributed in additionalcomponents. Similarly, in some embodiments, the functionality of some ofthe illustrated components may not be provided and/or other additionalfunctionality may be available.

Those skilled in the art will also appreciate that, while various itemsare illustrated as being stored in memory or on storage while beingused, these items or portions of them may be transferred between memoryand other storage devices for purposes of memory management and dataintegrity. Alternatively, in other embodiments some or all of thesoftware components may execute in memory on another device andcommunicate with the illustrated computer system via inter-computercommunication. Some or all of the system components or data structuresmay also be stored (e.g., as instructions or structured data) on acomputer-accessible medium or a portable article to be read by anappropriate drive, various examples of which are described above. Insome embodiments, instructions stored on a computer-accessible mediumseparate from computer system 2000 may be transmitted to computer system2000 via transmission media or signals such as electrical,electromagnetic, or digital signals, conveyed via a communication mediumsuch as a network and/or a wireless link. Various embodiments mayfurther include receiving, sending or storing instructions and/or dataimplemented in accordance with the foregoing description upon acomputer-accessible medium. Accordingly, the present invention may bepracticed with other computer system configurations.

CONCLUSION

Various embodiments may further include receiving, sending or storinginstructions and/or data implemented in accordance with the foregoingdescription upon a computer-accessible medium. Generally speaking, acomputer-accessible medium may include storage media or memory mediasuch as magnetic or optical media, e.g., disk or DVD/CD-ROM, volatile ornon-volatile media such as RAM (e.g. SDRAM, DDR, RDRAM, SRAM, etc.),ROM, etc., as well as transmission media or signals such as electrical,electromagnetic, or digital signals, conveyed via a communication mediumsuch as network and/or a wireless link.

The various methods as illustrated in the Figures and described hereinrepresent example embodiments of methods. The methods may be implementedin software, hardware, or a combination thereof. The order of method maybe changed, and various elements may be added, reordered, combined,omitted, modified, etc.

Various modifications and changes may be made as would be obvious to aperson skilled in the art having the benefit of this disclosure. It isintended that the invention embrace all such modifications and changesand, accordingly, the above description to be regarded in anillustrative rather than a restrictive sense.

What is claimed is:
 1. A method, comprising: generating, by one or morecomputing devices, a blur effect for an input image, wherein saidgenerating the blur effect comprises: obtaining input indicating alocation for each of one or more instances of a field blur pattern to beapplied to the input image and a value for a blur radius at each of theone or more instances of the field blur pattern; generating a blur maskfor the input image according to the location and the blur radius ofeach of the one or more instances of the field blur pattern, wherein theblur mask specifies a blur radius at each pixel of the input image, andwherein the blur mask specifies a uniform, linear, or complex gradientfield according to the input for the one or more instances of the fieldblur pattern; and rendering at least a portion of an output imageincluding the blur effect by applying at least a portion of the blurmask to at least a portion of the input image.
 2. The method as recitedin claim 1, wherein the input indicates the location and the value forthe blur radius of each of two or more instances of the field blurpattern, and wherein the two or more instances of the field blur patternare combined in the blur mask by multiplying normalized radius fields ofeach of the instances.
 3. The method as recited in claim 1, wherein theinput indicates the location and the value for the blur radius of oneinstance of the field blur pattern, where the one instance results in aspatially uniform blur effect.
 4. The method as recited in claim 1,wherein the input indicates the location and the value for the blurradius of each of two instances of the field blur pattern, where the twoinstances result in a spatially varying blur effect controlled by alinear gradient of blur radii.
 5. The method as recited in claim 1,wherein the input indicates the location and the value for the blurradius of each of three or more instances of the field blur pattern,where the three or more instances result in a complex spatially varyingblur effect controlled by the blur radii.
 6. The method as recited inclaim 1, further comprising displaying at least a portion of the inputimage in a user interface, wherein the location for each of the one ormore instances of the field blur pattern are graphically indicated onthe displayed at least a portion of the input image.
 7. The method asrecited in claim 6, wherein obtaining a value for a blur radius at oneof the one or more instances of the field blur pattern comprises:displaying a user interface element for the instance of the field blurpattern in response to selection of the respective indication of theinstance; and receiving input indicating the value for the blur radiusof the respective instance of the field blur pattern in response tomanipulation of the respective user interface element.
 8. The method asrecited in claim 7, wherein the indications of each of the one or moreinstances of the field blur pattern are pins graphically displayed inthe user interface, wherein the user interface element is graphicallydisplayed in the user interface centered on the respective pin.
 9. Themethod as recited in claim 1, wherein said applying at least a portionof the blur mask to at least a portion of the input image comprisesapplying a blur kernel to each pixel within the at least a portion ofthe input image according to a corresponding blur radius in the blurmask.
 10. A system, comprising: one or more processors; and a memorycomprising program instructions executable by at least one of the one ormore processors to generate a blur effect for an input image, wherein,to generate the blur effect, the program instructions are executable byat least one of the one or more processors to: obtain input indicating alocation for each of one or more instances of a field blur pattern to beapplied to the input image and a value for a blur radius at each of theone or more instances of the field blur pattern; generate a blur maskfor the input image according to the location and the blur radius ofeach of the one or more instances of the field blur pattern, wherein theblur mask specifies a blur radius at each pixel of the input image, andwherein the blur mask specifies a uniform, linear, or complex gradientfield according to the input for the one or more instances of the fieldblur pattern; and render at least a portion of an output image includingthe blur effect by applying at least a portion of the blur mask to atleast a portion of the input image.
 11. The system as recited in claim10, wherein the input indicates the location and the value for the blurradius of each of two or more instances of the field blur pattern, andwherein the program instructions are executable by at least one of theone or more processors to combine the two or more instances of the fieldblur pattern in the blur mask by multiplying normalized radius fields ofeach of the instances.
 12. The system as recited in claim 10, whereinthe input indicates one of: the location and the value for the blurradius of one instance of the field blur pattern, where the one instanceresults in a spatially uniform blur effect; the location and the valuefor the blur radius of each of two instances of the field blur pattern,where the two instances result in a spatially varying blur effectcontrolled by a linear gradient of the blur radii; or the location andthe value for the blur radius of each of three or more instances of thefield blur pattern, where the three or more instances result in acomplex spatially varying blur effect.
 13. The system as recited inclaim 10, further comprising a display device, wherein the programinstructions are executable by at least one of the one or moreprocessors to display at least a portion of the input image in a userinterface on the display device, wherein the location for each of theone or more instances of the field blur pattern are graphicallyindicated on the displayed at least a portion of the input image. 14.The system as recited in claim 13, wherein, to obtain a value for a blurradius at one of the one or more instances of the field blur pattern,the program instructions are executable by at least one of the one ormore processors to: display a user interface element for the instance ofthe field blur pattern in response to selection of the respectiveindication of the instance; and receive input indicating the value forthe blur radius of the respective instance of the field blur pattern inresponse to manipulation of the respective user interface element. 15.The system as recited in claim 10, wherein, to apply at least a portionof the blur mask to at least a portion of the input image, the programinstructions are executable by at least one of the one or moreprocessors to apply a blur kernel to each pixel within the at least aportion of the input image according to a corresponding blur radius inthe blur mask.
 16. A non-transitory computer-readable storage mediumstoring program instructions, wherein the program instructions arecomputer-executable to implement: generating a blur effect for an inputimage, wherein, in said generating the blur effect, the programinstructions are computer-executable to implement: obtaining inputindicating a location for each of one or more instances of a field blurpattern to be applied to the input image and a value for a blur radiusat each of the one or more instances of the field blur pattern;generating a blur mask for the input image according to the location andthe blur radius of each of the one or more instances of the field blurpattern, wherein the blur mask specifies a blur radius at each pixel ofthe input image, and wherein the blur mask specifies a uniform, linear,or complex gradient field according to the input for the one or moreinstances of the field blur pattern; and rendering at least a portion ofan output image including the blur effect by applying at least a portionof the blur mask to at least a portion of the input image.
 17. Thenon-transitory computer-readable storage medium as recited in claim 16,wherein the input indicates the location and the value for the blurradius of each of two or more instances of the field blur pattern, andwherein the program instructions are computer-executable to implementcombining the two or more instances of the field blur pattern in theblur mask by multiplying normalized radius fields of each of theinstances.
 18. The non-transitory computer-readable storage medium asrecited in claim 16, wherein the input indicates one of: the locationand the value for the blur radius of one instance of the field blurpattern, where the one instance results in a spatially uniform blureffect; the location and the value for the blur radius of each of twoinstances of the field blur pattern, where the two instances result in aspatially varying blur effect controlled by a linear gradient of theblur radii; or the location and the value for the blur radius of each ofthree or more instances of the field blur pattern, where the three ormore instances result in a complex spatially varying blur effect. 19.The non-transitory computer-readable storage medium as recited in claim16, wherein the program instructions are computer-executable toimplement displaying at least a portion of the input image in a userinterface, wherein the location for each of the one or more instances ofthe field blur pattern are graphically indicated on the displayed atleast a portion of the input image.
 20. The non-transitorycomputer-readable storage medium as recited in claim 19, wherein, insaid obtaining a value for a blur radius at one of the one or moreinstances of the field blur pattern, the program instructions arecomputer-executable to implement: displaying a user interface elementfor the instance of the field blur pattern in response to selection ofthe respective indication of the instance; and receiving inputindicating the value for the blur radius of the respective instance ofthe field blur pattern in response to manipulation of the respectiveuser interface element.
 21. The non-transitory computer-readable storagemedium as recited in claim 16, wherein, in said applying at least aportion of the blur mask to at least a portion of the input image, theprogram instructions are computer-executable to implement applying ablur kernel to each pixel within the at least a portion of the inputimage according to a corresponding blur radius in the blur mask.